andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 months ago
Clone
dc8c34
From 58517b8d4326132add54d44a8d3e9377c192056b Mon Sep 17 00:00:00 2001
dc8c34
From: Thierry Bordaz <tbordaz@redhat.com>
dc8c34
Date: Thu, 8 Sep 2016 11:38:15 +0200
dc8c34
Subject: [PATCH 393/394] Bug 1354331 - use a consumer maxcsn only as anchor if
dc8c34
 supplier is more advanced
dc8c34
dc8c34
(cherry picked from commit 40d005465f0faa3e84c8515d6ccb591d3bf1e4b5)
dc8c34
(cherry picked from commit ed420cd66c0e84a686ef3a4668e302d7a30affbe)
dc8c34
---
dc8c34
 ldap/servers/plugins/replication/cl5_clcache.c | 20 +++++++++-----------
dc8c34
 1 file changed, 9 insertions(+), 11 deletions(-)
dc8c34
dc8c34
diff --git a/ldap/servers/plugins/replication/cl5_clcache.c b/ldap/servers/plugins/replication/cl5_clcache.c
dc8c34
index 0b8feee..f6c56a9 100644
dc8c34
--- a/ldap/servers/plugins/replication/cl5_clcache.c
dc8c34
+++ b/ldap/servers/plugins/replication/cl5_clcache.c
dc8c34
@@ -747,24 +747,22 @@ clcache_adjust_anchorcsn ( CLC_Buffer *buf, int *flag )
dc8c34
 								curr, conmaxcsn);
dc8c34
 			}
dc8c34
 
dc8c34
-			if (csn_compare (cscb->local_maxcsn, cscb->prev_local_maxcsn) == 0 ||
dc8c34
-			    csn_compare (cscb->prev_local_maxcsn, buf->buf_current_csn) > 0 ) {
dc8c34
-				if (csn_compare (cscb->local_maxcsn, cscb->consumer_maxcsn) > 0 ) {
dc8c34
+			if (csn_compare(cscb->local_maxcsn, cscb->consumer_maxcsn) > 0) {
dc8c34
+				/* We have something to send for this RID */
dc8c34
+
dc8c34
+				if (csn_compare(cscb->local_maxcsn, cscb->prev_local_maxcsn) == 0 ||
dc8c34
+					csn_compare(cscb->prev_local_maxcsn, buf->buf_current_csn) > 0) {
dc8c34
+					/* No new changes or it remains, in the buffer, updates to send  */
dc8c34
 					rid_anchor = buf->buf_current_csn;
dc8c34
-				}
dc8c34
-			} else {
dc8c34
-				/* prev local max csn < csnBuffer AND different from local maxcsn */
dc8c34
-				if (cscb->prev_local_maxcsn == NULL) {
dc8c34
+				} else {
dc8c34
+					/* prev local max csn < csnBuffer AND different from local maxcsn */
dc8c34
 					if (cscb->consumer_maxcsn == NULL) {
dc8c34
 						/* the consumer hasn't seen changes for this RID */
dc8c34
 						rid_anchor = cscb->local_mincsn;
dc8c34
 						rid_flag = DB_SET;
dc8c34
-					} else if ( csn_compare (cscb->local_maxcsn, cscb->consumer_maxcsn) > 0 ) {
dc8c34
+					} else {
dc8c34
 						rid_anchor = cscb->consumer_maxcsn;
dc8c34
 					}
dc8c34
-				} else {
dc8c34
-					/* csnPrevMaxSup > 0 */
dc8c34
-					rid_anchor = cscb->consumer_maxcsn;
dc8c34
 				}
dc8c34
 			}
dc8c34
 
dc8c34
-- 
dc8c34
2.4.11
dc8c34