Blob Blame History Raw
From 0ea14f45cbc834e4791fdc393c5a2a042fd08101 Mon Sep 17 00:00:00 2001
From: Thierry Bordaz <tbordaz@redhat.com>
Date: Tue, 10 Jul 2018 12:07:45 +0200
Subject: [PATCH] Ticket 48818 - For a replica bindDNGroup, should be fetched
 the first time it is used not when the replica is started

Bug Description:
	The fetching of the bindDNGroup is working as designed but this ticket is to make it more flexible

	At startup, if the group does not contain the replica_mgr.
	No replication session will succeed until bindDnGroupCheckInterval delay.
	updatedn_group_last_check is the timestamp of the last fetch. At startup
	updatedn_group_last_check is set to the current time. So the next fetch will happen not before
	updatedn_group_last_check+bindDnGroupCheckInterval.

	If the groupDn is changed after startup, no incoming replication can happen for the first
	bindDnGroupCheckInterval seconds

Fix Description:
	The fix consist to unset updatedn_group_last_check so that the group will be fetch when the first
	incoming replication session will happen.

https://pagure.io/389-ds-base/issue/49818

Reviewed by: Mark Reynolds, Simon Spichugi (thanks !!!)

Platforms tested: F27

Flag Day: no

Doc impact: no
---
 ldap/servers/plugins/replication/repl5_replica.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ldap/servers/plugins/replication/repl5_replica.c b/ldap/servers/plugins/replication/repl5_replica.c
index dee20875e..41cad3bf0 100644
--- a/ldap/servers/plugins/replication/repl5_replica.c
+++ b/ldap/servers/plugins/replication/repl5_replica.c
@@ -2026,7 +2026,7 @@ _replica_init_from_config(Replica *r, Slapi_Entry *e, char *errortext)
     /* get replication bind dn groups */
     r->updatedn_groups = replica_updatedn_group_new(e);
     r->groupdn_list = replica_groupdn_list_new(r->updatedn_groups);
-    r->updatedn_group_last_check = time(NULL);
+    r->updatedn_group_last_check = 0;
     /* get groupdn check interval */
     if ((val = slapi_entry_attr_get_charptr(e, attr_replicaBindDnGroupCheckInterval))) {
         if (repl_config_valid_num(attr_replicaBindDnGroupCheckInterval, val, -1, INT_MAX, &rc, errormsg, &interval) != 0) {
-- 
2.17.1