From ee0b1a3bf11a4d05696212d91c932ddb7c7091ee Mon Sep 17 00:00:00 2001 From: Aravinda VK Date: Tue, 28 Jul 2015 14:52:00 +0530 Subject: geo-rep: Update last_synced_time in XSync During XSync crawl, last_synced time in status file was not updated. This patch fixes the issue by updating status file when stime xattr is updated after Xsync or Changelog Crawl. Change-Id: I4dc3a2d4c3d8378a939da0868caf1aef4f789599 Signed-off-by: Aravinda VK BUG: 1247536 Reviewed-on: http://review.gluster.org/11771 Tested-by: NetBSD Build System Reviewed-by: Jeff Darcy --- geo-replication/syncdaemon/master.py | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'geo-replication') diff --git a/geo-replication/syncdaemon/master.py b/geo-replication/syncdaemon/master.py index 5c17f96ae64..0555b95b36b 100644 --- a/geo-replication/syncdaemon/master.py +++ b/geo-replication/syncdaemon/master.py @@ -1003,13 +1003,6 @@ class GMasterChangelogMixin(GMasterCommon): if done: xtl = (int(change.split('.')[-1]) - 1, 0) self.upd_stime(xtl) - 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(xtl, checkpoint_time) map(self.changelog_done_func, changes) self.archive_and_purge_changelogs(changes) @@ -1037,13 +1030,6 @@ class GMasterChangelogMixin(GMasterCommon): if done: xtl = (int(change.split('.')[-1]) - 1, 0) self.upd_stime(xtl) - 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(xtl, checkpoint_time) map(self.changelog_done_func, changes) self.archive_and_purge_changelogs(changes) break @@ -1068,6 +1054,15 @@ class GMasterChangelogMixin(GMasterCommon): if not stime == URXTIME: 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) + def update_worker_remote_node(self): node = sys.argv[-1] node_data = node.split("@") -- cgit