From 04d7e356a7403ca7f5076561f140f2b3f921fd5e Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Wed, 26 Jul 2006 21:23:21 +0000 Subject: [PATCH] ITS#4534, don't update the context cookie with the delete syncID set cookie, that's only an intermediate value. ITS#4622, don't update the context cookie until all the nonpresent deletes are finished. --- servers/slapd/syncrepl.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index a15f7e68dc..919d73836c 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -808,11 +808,6 @@ do_syncrep2( &syncCookie_req.ctxcsn, &syncCookie.ctxcsn, &text ); } - if ( !BER_BVISNULL( &syncCookie.ctxcsn ) && - match < 0 && err == LDAP_SUCCESS ) - { - rc = syncrepl_updateCookie( si, op, psub, &syncCookie ); - } if ( rctrls ) { ldap_controls_free( rctrls ); } @@ -824,12 +819,17 @@ do_syncrep2( if ( refreshDeletes == 0 && match < 0 && err == LDAP_SUCCESS ) { - syncrepl_del_nonpresent( op, si, NULL, NULL ); + syncrepl_del_nonpresent( op, si, NULL, &syncCookie.ctxcsn ); } else { avl_free( si->si_presentlist, avl_ber_bvfree ); si->si_presentlist = NULL; } } + if ( !BER_BVISNULL( &syncCookie.ctxcsn ) && + match < 0 && err == LDAP_SUCCESS ) + { + rc = syncrepl_updateCookie( si, op, psub, &syncCookie ); + } if ( err == LDAP_SUCCESS && si->si_logstate == SYNCLOG_FALLBACK ) { si->si_logstate = SYNCLOG_LOGGING; @@ -930,6 +930,7 @@ do_syncrep2( } slap_sl_free( syncUUIDs, op->o_tmpmemctx ); } + slap_sync_cookie_free( &syncCookie, 0 ); break; default: Debug( LDAP_DEBUG_ANY, -- 2.39.5