[Pkg-openldap-devel] [openldap] 05/07: Import patch for 3way delta-MMR replication loop (#868753)

Ryan Tandy rtandy-guest at moszumanska.debian.org
Fri Aug 11 02:05:46 UTC 2017


This is an automated email from the git hooks/post-receive script.

rtandy-guest pushed a commit to branch stretch
in repository openldap.

commit 7e3d289a426acb32cf090802968d1c89aecc3e1b
Author: Ryan Tandy <ryan at nardis.ca>
Date:   Tue Aug 8 18:36:05 2017 -0700

    Import patch for 3way delta-MMR replication loop (#868753)
---
 debian/changelog                                   |  3 +
 ...32-fix-infinite-looping-mods-in-delta-mmr.patch | 64 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 3 files changed, 68 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index b93238c..52dab3c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,9 @@ openldap (2.4.44+dfsg-5+deb9u1) UNRELEASED; urgency=medium
   * Import upstream patch to avoid reading the value of the 
     LDAP_OPT_X_TLS_REQUIRE_CERT option from previously freed memory. 
     (ITS#8385) (Closes: #820244)
+  * Import upstream patch to fix potential endless replication loop in a 
+    multi-master delta-syncrepl scenario with 3 or more nodes.
+    (ITS#8432) (Closes: #868753)
 
  -- Ryan Tandy <ryan at nardis.ca>  Tue, 08 Aug 2017 18:19:08 -0700
 
diff --git a/debian/patches/ITS-8432-fix-infinite-looping-mods-in-delta-mmr.patch b/debian/patches/ITS-8432-fix-infinite-looping-mods-in-delta-mmr.patch
new file mode 100644
index 0000000..91c0196
--- /dev/null
+++ b/debian/patches/ITS-8432-fix-infinite-looping-mods-in-delta-mmr.patch
@@ -0,0 +1,64 @@
+From 92724fd39e3c6a65d460ad7a08d3acc3c16656e3 Mon Sep 17 00:00:00 2001
+From: Howard Chu <hyc at openldap.org>
+Date: Thu, 9 Jun 2016 22:37:54 +0100
+Subject: [PATCH] ITS#8432 fix infinite looping mods in delta-mmr
+
+---
+ servers/slapd/syncrepl.c | 32 ++++++++++++++++++++++++++++++++
+ 1 file changed, 32 insertions(+)
+
+--- a/servers/slapd/syncrepl.c
++++ b/servers/slapd/syncrepl.c
+@@ -934,6 +934,10 @@
+ 						check_syncprov( op, si );
+ 						ldap_pvt_thread_mutex_lock( &si->si_cookieState->cs_mutex );
+ 						for ( i =0; i<si->si_cookieState->cs_num; i++ ) {
++#ifdef CHATTY_SYNCLOG
++							Debug( LDAP_DEBUG_SYNC, "do_syncrep2: %s CSN for sid %d: %s\n",
++								si->si_ridtxt, i, si->si_cookieState->cs_vals[i].bv_val );
++#endif
+ 							/* new SID */
+ 							if ( sid < si->si_cookieState->cs_sids[i] )
+ 								break;
+@@ -2064,6 +2068,33 @@
+ 	if ( !mod )
+ 		return SLAP_CB_CONTINUE;
+ 
++	{
++		int i, sid;
++		sid = slap_parse_csn_sid( &mod->sml_nvalues[0] );
++		ldap_pvt_thread_mutex_lock( &si->si_cookieState->cs_mutex );
++		for ( i =0; i<si->si_cookieState->cs_num; i++ ) {
++#ifdef CHATTY_SYNCLOG
++			Debug( LDAP_DEBUG_SYNC, "syncrepl_op_modify: %s CSN for sid %d: %s\n",
++				si->si_ridtxt, i, si->si_cookieState->cs_vals[i].bv_val );
++#endif
++			/* new SID */
++			if ( sid < si->si_cookieState->cs_sids[i] )
++				break;
++			if ( si->si_cookieState->cs_sids[i] == sid ) {
++				if ( ber_bvcmp( &mod->sml_nvalues[0], &si->si_cookieState->cs_vals[i] ) <= 0 ) {
++					Debug( LDAP_DEBUG_SYNC, "syncrepl_op_modify: %s entryCSN too old, ignoring %s (%s)\n",
++						si->si_ridtxt, mod->sml_nvalues[0].bv_val, op->o_req_dn.bv_val );
++					ldap_pvt_thread_mutex_unlock( &si->si_cookieState->cs_mutex );
++					slap_graduate_commit_csn( op );
++					/* tell accesslog this was a failure */
++					rs->sr_err = LDAP_TYPE_OR_VALUE_EXISTS;
++					return LDAP_SUCCESS;
++				}
++			}
++		}
++		ldap_pvt_thread_mutex_unlock( &si->si_cookieState->cs_mutex );
++	}
++
+ 	rc = overlay_entry_get_ov( op, &op->o_req_ndn, NULL, NULL, 0, &e, on );
+ 	if ( rc == 0 ) {
+ 		Attribute *a;
+@@ -2077,6 +2108,7 @@
+ 	}
+ 	/* equal? Should never happen */
+ 	if ( match == 0 ) {
++		slap_graduate_commit_csn( op );
+ 		/* tell accesslog this was a failure */
+ 		rs->sr_err = LDAP_TYPE_OR_VALUE_EXISTS;
+ 		return LDAP_SUCCESS;
diff --git a/debian/patches/series b/debian/patches/series
index 7eaa68c..bfbbdc1 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -28,3 +28,4 @@ ITS-8554-kFreeBSD-is-like-BSD.patch
 ITS-8644-wait-for-slapd-to-start-in-test064.patch
 ITS-8655-paged-results-double-free.patch
 ITS-8385-Fix-use-after-free-with-GnuTLS.patch
+ITS-8432-fix-infinite-looping-mods-in-delta-mmr.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-openldap/openldap.git



More information about the Pkg-openldap-devel mailing list