]> git.sur5r.net Git - openldap/commitdiff
Shortcut syncrepl candidate selection if CSN is up to date
authorHoward Chu <hyc@openldap.org>
Wed, 22 Oct 2003 07:53:28 +0000 (07:53 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 22 Oct 2003 07:53:28 +0000 (07:53 +0000)
servers/slapd/back-bdb/search.c

index 39785dd96b8b00586599cc353003fc2936589937..122a6f3dec9d61189df17d512e97601c49fb6985 100644 (file)
@@ -668,6 +668,13 @@ dn2entry_retry:
                goto done;
        }
 
                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 );
        /* 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();
        }
 
                ldap_pvt_thread_yield();
        }
 
+nochange:
        if (!IS_PSEARCH) {
                if ( sop->o_sync_mode & SLAP_SYNC_REFRESH ) {
                        rs->sr_err = LDAP_SUCCESS;
        if (!IS_PSEARCH) {
                if ( sop->o_sync_mode & SLAP_SYNC_REFRESH ) {
                        rs->sr_err = LDAP_SUCCESS;