Blob Blame History Raw
From 7cb2e56db2da439c90bbfd35f132a85708942490 Mon Sep 17 00:00:00 2001
From: Ludwig Krispenz <lkrispen@redhat.com>
Date: Tue, 14 Nov 2017 11:25:18 +0100
Subject: [PATCH] Ticket 49413 - Changelog trimming ignores disabled
 replica-agreement

Bug: if a replication agreement is disabled it is not taken into account when
     changelog trimming determines where to stop.
     If the agreement is reenabled later replication can fail

Fix: do not ignore disabled agreements in changelog trimming

Reviewed by: Thierry, thanks
---
 ldap/servers/plugins/replication/cl5_api.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c
index 721013abf..dc2857910 100644
--- a/ldap/servers/plugins/replication/cl5_api.c
+++ b/ldap/servers/plugins/replication/cl5_api.c
@@ -4283,12 +4283,10 @@ _cl5GetRUV2Purge2(Object *fileObj, RUV **ruv)
     while (agmtObj) {
         agmt = (Repl_Agmt *)object_get_data(agmtObj);
         PR_ASSERT(agmt);
-
-        if (!agmt_is_enabled(agmt)) {
-            agmtObj = agmtlist_get_next_agreement_for_replica(r, agmtObj);
-            continue;
-        }
-
+        /* we need to handle all agreements, also if they are not enabled
+         * if they will be later enabled and changes are trimmed
+         * replication can fail
+         */
         consRUVObj = agmt_get_consumer_ruv(agmt);
         if (consRUVObj) {
             consRUV = (RUV *)object_get_data(consRUVObj);
-- 
2.13.6