]> git.sur5r.net Git - openldap/commitdiff
ITS#4534, don't update the context cookie with the delete syncID set
authorHoward Chu <hyc@openldap.org>
Wed, 26 Jul 2006 21:23:21 +0000 (21:23 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 26 Jul 2006 21:23:21 +0000 (21:23 +0000)
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

index a15f7e68dce196957bdcbc6efc57907bd3f2d3a5..919d73836c117a41f0f7302dd01fdb74579cbed1 100644 (file)
@@ -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,