andykimpe / rpms / 389-ds-base

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

Blame SOURCES/0077-Ticket-47627-Fix-replication-logging.patch

cc3dff
From 30144a9dabfe221cdded349078eaedf91cb53e88 Mon Sep 17 00:00:00 2001
cc3dff
From: Mark Reynolds <mreynolds@redhat.com>
cc3dff
Date: Sat, 14 Dec 2013 07:38:12 -0500
cc3dff
Subject: [PATCH 77/78] Ticket 47627 - Fix replication logging
cc3dff
cc3dff
We printed the same CSN for the missing CSN and the supplier min CSN because
cc3dff
we reused the same CSN pointer.
cc3dff
cc3dff
https://fedorahosted.org/389/ticket/47627
cc3dff
cc3dff
Reviewed by: rmeggins(Thanks!)
cc3dff
(cherry picked from commit 20cccf58108099cead2412a979e70e4f5972b806)
cc3dff
(cherry picked from commit ae3daa16783bab18f202a71b81177f4407dccdcd)
cc3dff
---
cc3dff
 ldap/servers/plugins/replication/cl5_api.c | 13 +++++++++----
cc3dff
 1 file changed, 9 insertions(+), 4 deletions(-)
cc3dff
cc3dff
diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c
cc3dff
index 064a628..abcc39a 100644
cc3dff
--- a/ldap/servers/plugins/replication/cl5_api.c
cc3dff
+++ b/ldap/servers/plugins/replication/cl5_api.c
cc3dff
@@ -5081,6 +5081,7 @@ static int _cl5PositionCursorForReplay (ReplicaId consumerRID, const RUV *consum
cc3dff
     int i;
cc3dff
     CSN **csns = NULL;
cc3dff
     CSN *startCSN = NULL;
cc3dff
+    CSN *minCSN = NULL;
cc3dff
     char csnStr [CSN_STRSIZE];
cc3dff
     int rc = CL5_SUCCESS;
cc3dff
     Object *supplierRuvObj = NULL;
cc3dff
@@ -5170,20 +5171,24 @@ static int _cl5PositionCursorForReplay (ReplicaId consumerRID, const RUV *consum
cc3dff
 		*/
cc3dff
         if ((rc == DB_NOTFOUND) && !ruv_has_csns(file->purgeRUV))
cc3dff
         {
cc3dff
+            char mincsnStr[CSN_STRSIZE];
cc3dff
+
cc3dff
             /* use the supplier min csn for the buffer start csn - we know
cc3dff
                this csn is in our changelog */
cc3dff
-            if ((RUV_SUCCESS == ruv_get_min_csn_ext(supplierRuv, &startCSN, 1 /* ignore cleaned rids */)) &&
cc3dff
-                startCSN)
cc3dff
+            if ((RUV_SUCCESS == ruv_get_min_csn_ext(supplierRuv, &minCSN, 1 /* ignore cleaned rids */)) &&
cc3dff
+                minCSN)
cc3dff
             { /* must now free startCSN */
cc3dff
                 if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) {
cc3dff
-                    csn_as_string(startCSN, PR_FALSE, csnStr); 
cc3dff
+                    csn_as_string(startCSN, PR_FALSE, csnStr);
cc3dff
+                    csn_as_string(minCSN, PR_FALSE, mincsnStr);
cc3dff
                     slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, 
cc3dff
                                     "%s: CSN %s not found and no purging, probably a reinit\n",
cc3dff
                                     agmt_name, csnStr);
cc3dff
                     slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, 
cc3dff
                                     "%s: Will try to use supplier min CSN %s to load changelog\n",
cc3dff
-                                    agmt_name, csnStr);
cc3dff
+                                    agmt_name, mincsnStr);
cc3dff
                 }
cc3dff
+                startCSN = minCSN;
cc3dff
                 rc = clcache_load_buffer (clcache, startCSN, DB_SET);
cc3dff
             }
cc3dff
             else
cc3dff
-- 
cc3dff
1.8.1.4
cc3dff