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

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