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

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