Blame SOURCES/0048-Ticket-49446-cleanallruv-should-ignore-cleaned-repli.patch

081b2d
From 7fa2f146c80ed64217bb0c1022c99bd1948cdc7c Mon Sep 17 00:00:00 2001
081b2d
From: Ludwig Krispenz <lkrispen@redhat.com>
081b2d
Date: Thu, 11 Jan 2018 15:56:21 +0100
081b2d
Subject: [PATCH] Ticket 49446 - cleanallruv should ignore cleaned replica Id
081b2d
 in processing changelog if in force mode
081b2d
081b2d
Bug: If the startcsn is calculated based on a cleaned rid, it could be missing from the changelog.
081b2d
081b2d
Fix: In force mode we do not care that the topology gets in sync for the cleaned RID, so we can ignore it
081b2d
     in an earlier stage, instead of setting it to precleane only.
081b2d
081b2d
Reviewed by: Thierry, thanks
081b2d
---
081b2d
 ldap/servers/plugins/replication/repl5_replica_config.c | 10 ++++++++--
081b2d
 1 file changed, 8 insertions(+), 2 deletions(-)
081b2d
081b2d
diff --git a/ldap/servers/plugins/replication/repl5_replica_config.c b/ldap/servers/plugins/replication/repl5_replica_config.c
081b2d
index e025f34d8..005528a41 100644
081b2d
--- a/ldap/servers/plugins/replication/repl5_replica_config.c
081b2d
+++ b/ldap/servers/plugins/replication/repl5_replica_config.c
081b2d
@@ -1688,9 +1688,15 @@ replica_cleanallruv_thread(void *arg)
081b2d
     }
081b2d
     /*
081b2d
      *  Presetting the rid prevents duplicate thread creation, but allows the db and changelog to still
081b2d
-     *  process updates from the rid.  set_cleaned_rid() blocks updates, so we don't want to do that... yet.
081b2d
+     *  process updates from the rid.
081b2d
+     *  set_cleaned_rid() blocks updates, so we don't want to do that... yet unless we are in force mode.
081b2d
+     *  If we are forcing a clean independent of state of other servers for this RID we can set_cleaned_rid()
081b2d
      */
081b2d
-    preset_cleaned_rid(data->rid);
081b2d
+    if (data->force) {
081b2d
+        set_cleaned_rid(data->rid);
081b2d
+    } else {
081b2d
+        preset_cleaned_rid(data->rid);
081b2d
+    }
081b2d
     rid_text = slapi_ch_smprintf("%d", data->rid);
081b2d
     csn_as_string(data->maxcsn, PR_FALSE, csnstr);
081b2d
     /*
081b2d
-- 
081b2d
2.13.6
081b2d