Blob Blame History Raw
From 8b802ff5bed5f8b3fc72c86f643412178c34dcb3 Mon Sep 17 00:00:00 2001
From: Aravinda VK <avishwan@redhat.com>
Date: Thu, 17 Nov 2016 17:47:29 +0530
Subject: [PATCH 203/206] geo-rep: Fix Last synced status column issue during
 Hybrid Crawl

During Hybrid crawl, Geo-rep maintains stime xattr in subdirectories along
with the Brick root. This is done to skip directories if Geo-rep crashes
before Hybrid crawl completes.

Update Last synced status only when stime xattr updated in brick root.
Status output will mislead if it shows sub directory stime as
last synced time.

> Reviewed-on: http://review.gluster.org/15869
> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
> Smoke: Gluster Build System <jenkins@build.gluster.org>
> Reviewed-by: Kotresh HR <khiremat@redhat.com>

BUG: 1397286
Change-Id: I5b73aee7ae4a1c1e2d1001d1f55559b9f9efd6e6
Signed-off-by: Aravinda VK <avishwan@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/91509
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
---
 geo-replication/syncdaemon/master.py | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/geo-replication/syncdaemon/master.py b/geo-replication/syncdaemon/master.py
index 796b980..b65abf9 100644
--- a/geo-replication/syncdaemon/master.py
+++ b/geo-replication/syncdaemon/master.py
@@ -1069,13 +1069,15 @@ class GMasterChangelogMixin(GMasterCommon):
             self.sendmark(path, stime)
 
         # Update last_synced_time in status file based on stime
-        chkpt_time = gconf.configinterface.get_realtime(
-            "checkpoint")
-        checkpoint_time = 0
-        if chkpt_time is not None:
-            checkpoint_time = int(chkpt_time)
-
-        self.status.set_last_synced(stime, checkpoint_time)
+        # only update stime if stime xattr set to Brick root
+        if path == self.FLAT_DIR_HIERARCHY:
+            chkpt_time = gconf.configinterface.get_realtime(
+                "checkpoint")
+            checkpoint_time = 0
+            if chkpt_time is not None:
+                checkpoint_time = int(chkpt_time)
+
+            self.status.set_last_synced(stime, checkpoint_time)
 
     def update_worker_remote_node(self):
         node = sys.argv[-1]
-- 
2.9.3