andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 months ago
Clone

Blame SOURCES/0001-Ticket-48818-For-a-replica-bindDNGroup-should-be-fet.patch

31affc
From 0ea14f45cbc834e4791fdc393c5a2a042fd08101 Mon Sep 17 00:00:00 2001
31affc
From: Thierry Bordaz <tbordaz@redhat.com>
31affc
Date: Tue, 10 Jul 2018 12:07:45 +0200
31affc
Subject: [PATCH] Ticket 48818 - For a replica bindDNGroup, should be fetched
31affc
 the first time it is used not when the replica is started
31affc
31affc
Bug Description:
31affc
	The fetching of the bindDNGroup is working as designed but this ticket is to make it more flexible
31affc
31affc
	At startup, if the group does not contain the replica_mgr.
31affc
	No replication session will succeed until bindDnGroupCheckInterval delay.
31affc
	updatedn_group_last_check is the timestamp of the last fetch. At startup
31affc
	updatedn_group_last_check is set to the current time. So the next fetch will happen not before
31affc
	updatedn_group_last_check+bindDnGroupCheckInterval.
31affc
31affc
	If the groupDn is changed after startup, no incoming replication can happen for the first
31affc
	bindDnGroupCheckInterval seconds
31affc
31affc
Fix Description:
31affc
	The fix consist to unset updatedn_group_last_check so that the group will be fetch when the first
31affc
	incoming replication session will happen.
31affc
31affc
https://pagure.io/389-ds-base/issue/49818
31affc
31affc
Reviewed by: Mark Reynolds, Simon Spichugi (thanks !!!)
31affc
31affc
Platforms tested: F27
31affc
31affc
Flag Day: no
31affc
31affc
Doc impact: no
31affc
---
31affc
 ldap/servers/plugins/replication/repl5_replica.c | 2 +-
31affc
 1 file changed, 1 insertion(+), 1 deletion(-)
31affc
31affc
diff --git a/ldap/servers/plugins/replication/repl5_replica.c b/ldap/servers/plugins/replication/repl5_replica.c
31affc
index dee20875e..41cad3bf0 100644
31affc
--- a/ldap/servers/plugins/replication/repl5_replica.c
31affc
+++ b/ldap/servers/plugins/replication/repl5_replica.c
31affc
@@ -2026,7 +2026,7 @@ _replica_init_from_config(Replica *r, Slapi_Entry *e, char *errortext)
31affc
     /* get replication bind dn groups */
31affc
     r->updatedn_groups = replica_updatedn_group_new(e);
31affc
     r->groupdn_list = replica_groupdn_list_new(r->updatedn_groups);
31affc
-    r->updatedn_group_last_check = time(NULL);
31affc
+    r->updatedn_group_last_check = 0;
31affc
     /* get groupdn check interval */
31affc
     if ((val = slapi_entry_attr_get_charptr(e, attr_replicaBindDnGroupCheckInterval))) {
31affc
         if (repl_config_valid_num(attr_replicaBindDnGroupCheckInterval, val, -1, INT_MAX, &rc, errormsg, &interval) != 0) {
31affc
-- 
31affc
2.17.1
31affc