From: Howard Chu Date: Sat, 15 Oct 2005 00:31:22 +0000 (+0000) Subject: Add option to enable using the reloadHint. 2.2 consumers never sent this X-Git-Tag: OPENLDAP_REL_ENG_2_2_MP~247 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d98dee3e192d6115ec08992933d2252928db2f09;p=openldap Add option to enable using the reloadHint. 2.2 consumers never sent this hint. The 2.3 consumer needs it for delta-syncrepl. --- diff --git a/servers/slapd/overlays/syncprov.c b/servers/slapd/overlays/syncprov.c index 38946321c1..ceb2d9eea6 100644 --- a/servers/slapd/overlays/syncprov.c +++ b/servers/slapd/overlays/syncprov.c @@ -122,6 +122,7 @@ typedef struct syncprov_info_t { int si_chktime; int si_numops; /* number of ops since last checkpoint */ int si_nopres; /* Skip present phase */ + int si_usehint; /* use reload hint */ time_t si_chklast; /* time of last checkpoint */ Avlnode *si_mods; /* entries being modified */ sessionlog *si_logs; @@ -1943,12 +1944,11 @@ syncprov_op_search( Operation *op, SlapReply *rs ) /* Is the CSN still present in the database? */ if ( syncprov_findcsn( op, FIND_CSN ) != LDAP_SUCCESS ) { /* No, so a reload is required */ -#if 0 /* the consumer doesn't seem to send this hint */ - if ( op->o_sync_rhint == 0 ) { + /* the 2.2 consumer doesn't send this hint */ + if ( si->si_usehint && srs->sr_rhint == 0 ) { send_ldap_error( op, rs, LDAP_SYNC_REFRESH_REQUIRED, "sync cookie is stale" ); return rs->sr_err; } -#endif } else { gotstate = 1; /* If changed and doing Present lookup, send Present UUIDs */ @@ -2069,7 +2069,8 @@ syncprov_operational( enum { SP_CHKPT = 1, SP_SESSL, - SP_NOPRES + SP_NOPRES, + SP_USEHINT }; static ConfigDriver sp_cf_gen; @@ -2087,6 +2088,10 @@ static ConfigTable spcfg[] = { sp_cf_gen, "( OLcfgOvAt:1.3 NAME 'olcSpNoPresent' " "DESC 'Omit Present phase processing' " "SYNTAX OMsBoolean SINGLE-VALUE )", NULL, NULL }, + { "syncprov-reloadhint", NULL, 2, 2, 0, ARG_ON_OFF|ARG_MAGIC|SP_USEHINT, + sp_cf_gen, "( OLcfgOvAt:1.4 NAME 'olcSpReloadHint' " + "DESC 'Observe Reload Hint in Request control' " + "SYNTAX OMsBoolean SINGLE-VALUE )", NULL, NULL }, { NULL, NULL, 0, 0, 0, ARG_IGNORED } };