Fix back-bdb inequality_candidates to use unchecked limit.

Fix syncprov_findcsn to set unchecked limit. (ITS#3939)
This commit is contained in:
Howard Chu 2005-11-20 10:39:05 +00:00
parent 3bea8f5836
commit 3167b29812
2 changed files with 8 additions and 5 deletions

View File

@ -978,7 +978,6 @@ inequality_candidates(
{
struct bdb_info *bdb = (struct bdb_info *) op->o_bd->be_private;
DB *db;
int i;
int rc;
slap_mask_t mask;
struct berval prefix = {0, NULL};
@ -1066,9 +1065,9 @@ inequality_candidates(
bdb_idl_union( ids, tmp );
if( BDB_IDL_IS_ZERO( ids ) )
if( op->ors_limit && op->ors_limit->lms_s_unchecked != -1 &&
BDB_IDL_N( ids ) >= (unsigned) op->ors_limit->lms_s_unchecked )
break;
i++;
}
ber_bvarray_free_x( keys, op->o_tmpmemctx );

View File

@ -583,10 +583,10 @@ syncprov_findcsn( Operation *op, find_csn_t mode )
#else
AttributeAssertion eq = { NULL, BER_BVNULL };
#endif
int i, rc = LDAP_SUCCESS;
fpres_cookie pcookie;
sync_control *srs = NULL;
int findcsn_retry = 1;
struct slap_limits_set fc_limits;
int i, rc = LDAP_SUCCESS, findcsn_retry = 1;
if ( mode != FIND_MAXCSN ) {
srs = op->o_controls[slap_cids.sc_LDAPsync];
@ -637,6 +637,8 @@ again:
/* On retry, look for <= */
} else {
cf.f_choice = LDAP_FILTER_LE;
fop.ors_limit = &fc_limits;
fc_limits.lms_s_unchecked = 1;
fop.ors_filterstr.bv_len = sprintf( buf, "(entryCSN<=%s)",
cf.f_av_value.bv_val );
}
@ -1244,7 +1246,9 @@ syncprov_checkpoint( Operation *op, SlapReply *rs, slap_overinst *on )
opm.o_req_ndn = op->o_bd->be_nsuffix[0];
opm.o_bd->bd_info = on->on_info->oi_orig;
opm.o_managedsait = SLAP_CONTROL_NONCRITICAL;
SLAP_DBFLAGS( opm.o_bd ) |= SLAP_DBFLAG_NOLASTMOD;
opm.o_bd->be_modify( &opm, &rsm );
SLAP_DBFLAGS( opm.o_bd ) ^= SLAP_DBFLAG_NOLASTMOD;
if ( mod.sml_next != NULL ) {
slap_mods_free( mod.sml_next, 1 );
}