From f1ef6b0c1e5d6f0f7eb67e85b3837c0cf33642c9 Mon Sep 17 00:00:00 2001 From: Aravinda VK Date: Thu, 17 Nov 2016 17:47:29 +0530 Subject: 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 > CentOS-regression: Gluster Build System > Smoke: Gluster Build System > Reviewed-by: Kotresh HR BUG: 1399470 Change-Id: I5b73aee7ae4a1c1e2d1001d1f55559b9f9efd6e6 Signed-off-by: Aravinda VK (cherry picked from commit 1876454d2e7950f25d1e5bb8e2c07ab27d521498) Reviewed-on: http://review.gluster.org/15962 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Saravanakumar Arumugam --- 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 2c4d8c581a4..d2481ee06ec 100644 --- a/geo-replication/syncdaemon/master.py +++ b/geo-replication/syncdaemon/master.py @@ -1139,13 +1139,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] -- cgit