zrhoffman / rpms / 389-ds-base

Forked from rpms/389-ds-base 3 years ago
Clone

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

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