From 95a58669650669175bbb67c90a754fdf33621741 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Wed, 22 Oct 2003 07:53:28 +0000 Subject: [PATCH] Shortcut syncrepl candidate selection if CSN is up to date --- servers/slapd/back-bdb/search.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/servers/slapd/back-bdb/search.c b/servers/slapd/back-bdb/search.c index 39785dd96b..122a6f3dec 100644 --- a/servers/slapd/back-bdb/search.c +++ b/servers/slapd/back-bdb/search.c @@ -668,6 +668,13 @@ dn2entry_retry: goto done; } + if ( sop->o_sync_state.bv_val && ber_bvcmp( &sop->o_sync_state, + search_context_csn ) == 0 ) + { + bdb_cache_entry_db_unlock( bdb->bi_dbenv, &ctxcsn_lock ); + goto nochange; + } + /* select candidates */ if ( sop->oq_search.rs_scope == LDAP_SCOPE_BASE ) { rs->sr_err = base_candidate( op->o_bd, &base, candidates ); @@ -1245,6 +1252,7 @@ loop_continue: ldap_pvt_thread_yield(); } +nochange: if (!IS_PSEARCH) { if ( sop->o_sync_mode & SLAP_SYNC_REFRESH ) { rs->sr_err = LDAP_SUCCESS; -- 2.39.5