From 0347caa20f057f1174adf060ac64289a0950eb8a Mon Sep 17 00:00:00 2001 From: Quanah Gibson-Mount Date: Wed, 13 Feb 2008 19:06:05 +0000 Subject: [PATCH] ITS#5376 --- CHANGES | 1 + servers/slapd/syncrepl.c | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 602790ec1d..9bde938991 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,7 @@ OpenLDAP 2.3 Change Log OpenLDAP 2.3.41 Engineering Fixed slapd idlcache on adds (ITS#5086) Fixed slapd timestamp race condition (ITS#5370) + Fixed slapd delta-syncrepl refresh mode (ITS#5376) Fixed slapd-bdb modrdn to same dn (ITS#5319) Fixed slapd-bdb crash with modrdn (ITS#5358) Fixed slapo-accesslog cleanup on successful response (ITS#5374) diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index f9dbd79474..aeeafdf549 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -84,6 +84,7 @@ typedef struct syncinfo_s { int si_syncdata; int si_logstate; int si_conn_setup; + ber_int_t si_msgid; Avlnode *si_presentlist; LDAP *si_ld; LDAP_LIST_HEAD(np, nonpresent_entry) si_nonpresentlist; @@ -315,7 +316,6 @@ ldap_sync_search( BerElement *ber = (BerElement *)&berbuf; LDAPControl c[2], *ctrls[3]; struct timeval timeout; - ber_int_t msgid; int rc; int rhint; char *base; @@ -403,7 +403,7 @@ ldap_sync_search( rc = ldap_search_ext( si->si_ld, base, scope, filter, attrs, attrsonly, ctrls, NULL, si->si_tlimit > 0 ? &timeout : NULL, - si->si_slimit, &msgid ); + si->si_slimit, &si->si_msgid ); ber_free_buf( ber ); return rc; } @@ -667,7 +667,7 @@ do_syncrep2( tout_p = NULL; } - while (( rc = ldap_result( si->si_ld, LDAP_RES_ANY, LDAP_MSG_ONE, + while (( rc = ldap_result( si->si_ld, si->si_msgid, LDAP_MSG_ONE, tout_p, &res )) > 0 ) { if ( slapd_shutdown ) { @@ -722,6 +722,10 @@ do_syncrep2( if (( rc = syncrepl_message_to_op( si, op, msg )) == LDAP_SUCCESS && !BER_BVISNULL( &syncCookie.ctxcsn ) ) { syncrepl_updateCookie( si, op, psub, &syncCookie ); + } else if ( rc == LDAP_NO_SUCH_OBJECT ) { + rc = LDAP_SYNC_REFRESH_REQUIRED; + si->si_logstate = SYNCLOG_FALLBACK; + ldap_abandon_ext( si->si_ld, si->si_msgid, NULL, NULL ); } } else if (( rc = syncrepl_message_to_entry( si, op, msg, &modlist, &entry, syncstate )) == LDAP_SUCCESS ) { -- 2.39.2