From 8a4b26e41ec8941f052c007fd54fbb499dd7ddd3 Mon Sep 17 00:00:00 2001 From: Ludwig Krispenz Date: Jan 11 2018 15:57:58 +0000 Subject: 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 --- diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c index 721013a..dc28579 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);