3604df
From 8b802ff5bed5f8b3fc72c86f643412178c34dcb3 Mon Sep 17 00:00:00 2001
3604df
From: Aravinda VK <avishwan@redhat.com>
3604df
Date: Thu, 17 Nov 2016 17:47:29 +0530
3604df
Subject: [PATCH 203/206] geo-rep: Fix Last synced status column issue during
3604df
 Hybrid Crawl
3604df
3604df
During Hybrid crawl, Geo-rep maintains stime xattr in subdirectories along
3604df
with the Brick root. This is done to skip directories if Geo-rep crashes
3604df
before Hybrid crawl completes.
3604df
3604df
Update Last synced status only when stime xattr updated in brick root.
3604df
Status output will mislead if it shows sub directory stime as
3604df
last synced time.
3604df
3604df
> Reviewed-on: http://review.gluster.org/15869
3604df
> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
3604df
> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
3604df
> Smoke: Gluster Build System <jenkins@build.gluster.org>
3604df
> Reviewed-by: Kotresh HR <khiremat@redhat.com>
3604df
3604df
BUG: 1397286
3604df
Change-Id: I5b73aee7ae4a1c1e2d1001d1f55559b9f9efd6e6
3604df
Signed-off-by: Aravinda VK <avishwan@redhat.com>
3604df
Reviewed-on: https://code.engineering.redhat.com/gerrit/91509
3604df
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
3604df
---
3604df
 geo-replication/syncdaemon/master.py | 16 +++++++++-------
3604df
 1 file changed, 9 insertions(+), 7 deletions(-)
3604df
3604df
diff --git a/geo-replication/syncdaemon/master.py b/geo-replication/syncdaemon/master.py
3604df
index 796b980..b65abf9 100644
3604df
--- a/geo-replication/syncdaemon/master.py
3604df
+++ b/geo-replication/syncdaemon/master.py
3604df
@@ -1069,13 +1069,15 @@ class GMasterChangelogMixin(GMasterCommon):
3604df
             self.sendmark(path, stime)
3604df
 
3604df
         # Update last_synced_time in status file based on stime
3604df
-        chkpt_time = gconf.configinterface.get_realtime(
3604df
-            "checkpoint")
3604df
-        checkpoint_time = 0
3604df
-        if chkpt_time is not None:
3604df
-            checkpoint_time = int(chkpt_time)
3604df
-
3604df
-        self.status.set_last_synced(stime, checkpoint_time)
3604df
+        # only update stime if stime xattr set to Brick root
3604df
+        if path == self.FLAT_DIR_HIERARCHY:
3604df
+            chkpt_time = gconf.configinterface.get_realtime(
3604df
+                "checkpoint")
3604df
+            checkpoint_time = 0
3604df
+            if chkpt_time is not None:
3604df
+                checkpoint_time = int(chkpt_time)
3604df
+
3604df
+            self.status.set_last_synced(stime, checkpoint_time)
3604df
 
3604df
     def update_worker_remote_node(self):
3604df
         node = sys.argv[-1]
3604df
-- 
3604df
2.9.3
3604df