andykimpe / rpms / 389-ds-base

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

Blame SOURCES/0009-Issue-3903-keep-alive-update-event-starts-too-soon.patch

cb1cc6
From 27f0c60a54514773e3ffaa09cfbb71c350f44143 Mon Sep 17 00:00:00 2001
cb1cc6
From: Mark Reynolds <mreynolds@redhat.com>
cb1cc6
Date: Sat, 6 Aug 2022 14:03:16 -0400
cb1cc6
Subject: [PATCH 5/5] Issue 3903 - keep alive update event starts too soon
cb1cc6
cb1cc6
Description: THe keep alive update needs a little more time to start to
cb1cc6
allow changelog, and other replication protocols to startup
cb1cc6
cb1cc6
relates: https://github.com/389ds/389-ds-base/issues/3903
cb1cc6
cb1cc6
Reviewed by: tbordaz (Thanks!)
cb1cc6
---
cb1cc6
 dirsrvtests/tests/suites/replication/regression_m2_test.py | 5 +++++
cb1cc6
 ldap/servers/plugins/replication/repl5_replica.c           | 7 ++++---
cb1cc6
 2 files changed, 9 insertions(+), 3 deletions(-)
cb1cc6
cb1cc6
diff --git a/dirsrvtests/tests/suites/replication/regression_m2_test.py b/dirsrvtests/tests/suites/replication/regression_m2_test.py
cb1cc6
index 7dd0f2984..bbf9c8486 100644
cb1cc6
--- a/dirsrvtests/tests/suites/replication/regression_m2_test.py
cb1cc6
+++ b/dirsrvtests/tests/suites/replication/regression_m2_test.py
cb1cc6
@@ -821,6 +821,11 @@ def test_keepalive_entries(topo_m2):
cb1cc6
     assert keep_alive_s1 != str(entries[0].data['keepalivetimestamp'])
cb1cc6
     assert keep_alive_s2 != str(entries[1].data['keepalivetimestamp'])
cb1cc6
 
cb1cc6
+    # Test replication
cb1cc6
+    supplier = topo_m2.ms['supplier1']
cb1cc6
+    replica = Replicas(supplier).get(DEFAULT_SUFFIX)
cb1cc6
+    assert replica.test_replication([topo_m2.ms['supplier2']])
cb1cc6
+
cb1cc6
 
cb1cc6
 @pytest.mark.ds49915
cb1cc6
 @pytest.mark.bz1626375
cb1cc6
diff --git a/ldap/servers/plugins/replication/repl5_replica.c b/ldap/servers/plugins/replication/repl5_replica.c
cb1cc6
index ded4cf754..fa6419262 100644
cb1cc6
--- a/ldap/servers/plugins/replication/repl5_replica.c
cb1cc6
+++ b/ldap/servers/plugins/replication/repl5_replica.c
cb1cc6
@@ -239,7 +239,7 @@ replica_new_from_entry(Slapi_Entry *e, char *errortext, PRBool is_add_operation,
cb1cc6
     /* create supplier update event */
cb1cc6
     if (r->repl_eqcxt_ka_update == NULL && replica_get_type(r) == REPLICA_TYPE_UPDATABLE) {
cb1cc6
         r->repl_eqcxt_ka_update = slapi_eq_repeat_rel(replica_subentry_update, r,
cb1cc6
-                                                   slapi_current_rel_time_t() + START_UPDATE_DELAY,
cb1cc6
+                                                   slapi_current_rel_time_t() + 30,
cb1cc6
                                                    replica_get_keepalive_update_interval(r));
cb1cc6
     }
cb1cc6
 
cb1cc6
@@ -415,8 +415,9 @@ replica_subentry_create(const char *repl_root, ReplicaId rid)
cb1cc6
     int return_value;
cb1cc6
     int rc = 0;
cb1cc6
 
cb1cc6
-    entry_string = slapi_ch_smprintf("dn: cn=%s %d,%s\nobjectclass: top\nobjectclass: ldapsubentry\nobjectclass: extensibleObject\ncn: %s %d",
cb1cc6
-                                     KEEP_ALIVE_ENTRY, rid, repl_root, KEEP_ALIVE_ENTRY, rid);
cb1cc6
+    entry_string = slapi_ch_smprintf("dn: cn=%s %d,%s\nobjectclass: top\nobjectclass: ldapsubentry\n"
cb1cc6
+                                     "objectclass: extensibleObject\n%s: 0\ncn: %s %d",
cb1cc6
+                                     KEEP_ALIVE_ENTRY, rid, repl_root, KEEP_ALIVE_ATTR, KEEP_ALIVE_ENTRY, rid);
cb1cc6
     if (entry_string == NULL) {
cb1cc6
         slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name,
cb1cc6
                       "replica_subentry_create - Failed in slapi_ch_smprintf\n");
cb1cc6
-- 
cb1cc6
2.37.1
cb1cc6