]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/syncrepl.c
ITS#6385. Not noting in changes as it is new breakage since 2.4.19 as part of other...
[openldap] / servers / slapd / syncrepl.c
index 4933933935cc9cea4fd97f3c51fdcdf6307be4d8..ffefe52e813588bc19f88f0fcbe37b44995d21f0 100644 (file)
@@ -665,6 +665,11 @@ do_syncrep1(
                        si->si_syncCookie.ctxcsn, si->si_syncCookie.rid,
                        si->si_syncCookie.sid );
        } else {
+               /* ITS#6367: recreate the cookie so it has our SID, not our peer's */
+               ch_free( si->si_syncCookie.octet_str.bv_val );
+               slap_compose_sync_cookie( NULL, &si->si_syncCookie.octet_str,
+                       si->si_syncCookie.ctxcsn, si->si_syncCookie.rid,
+                       si->si_syncCookie.sid );
                /* Look for contextCSN from syncprov overlay. */
                check_syncprov( op, si );
        }
@@ -3713,7 +3718,7 @@ syncinfo_free( syncinfo_t *sie, int free_all )
                if ( sie->si_logbase.bv_val ) {
                        ch_free( sie->si_logbase.bv_val );
                }
-               if ( SLAP_SYNC_SUBENTRY( sie->si_be )) {
+               if ( sie->si_be && SLAP_SYNC_SUBENTRY( sie->si_be )) {
                        ch_free( sie->si_contextdn.bv_val );
                }
                if ( sie->si_attrs ) {
@@ -3925,6 +3930,12 @@ parse_syncrepl_retry(
                        }
                }
        }
+       if ( j < 1 || si->si_retrynum_init[j-1] != RETRYNUM_FOREVER ) {
+               Debug( LDAP_DEBUG_CONFIG,
+                       "%s: syncrepl will eventually stop retrying; the \"retry\" parameter should end with a '+'.\n",
+                       c->log, 0, 0 );
+       }
+
        si->si_retrynum_init[j] = RETRYNUM_TAIL;
        si->si_retrynum[j] = RETRYNUM_TAIL;
        si->si_retryinterval[j] = 0;