From f0b92a45e5c757ec25257e389c877b9b0de8ed07 Mon Sep 17 00:00:00 2001 From: Venky Shankar Date: Wed, 31 Jul 2013 19:40:28 +0530 Subject: gsyncd / geo-rep: periodically set slave xtime on slave setting the slave xtime on the slave (after each changelog/xsync) crawl helps in two things: * effective recover of master (failover/failback) * cascading setup - instances when the session from intermediate master session is stopped, data is put on the master -> slave sesssion and then the cascading session is started again. Change-Id: Ifae10a6ac09dc0d17707c3b5a3090bcf1efec8b6 BUG: 990900 Signed-off-by: Venky Shankar Reviewed-on: http://review.gluster.org/5451 Tested-by: Gluster Build System Reviewed-by: Avra Sengupta Tested-by: Avra Sengupta Reviewed-by: Anand Avati --- geo-replication/syncdaemon/master.py | 1 + geo-replication/syncdaemon/resource.py | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/geo-replication/syncdaemon/master.py b/geo-replication/syncdaemon/master.py index 58df14954..12eadb107 100644 --- a/geo-replication/syncdaemon/master.py +++ b/geo-replication/syncdaemon/master.py @@ -147,6 +147,7 @@ class NormalMixin(object): def set_slave_xtime(self, path, mark): self.slave.server.set_xtime(path, self.uuid, mark) + self.slave.server.set_xtime_remote(path, self.uuid, mark) class PartialMixin(NormalMixin): """a variant tuned towards operation with a master diff --git a/geo-replication/syncdaemon/resource.py b/geo-replication/syncdaemon/resource.py index 297cdabcb..1010247ae 100644 --- a/geo-replication/syncdaemon/resource.py +++ b/geo-replication/syncdaemon/resource.py @@ -431,6 +431,18 @@ class Server(object): """set @mark as xtime for @uuid on @path""" Xattr.lsetxattr(path, '.'.join([cls.GX_NSPACE, uuid, 'xtime']), struct.pack('!II', *mark)) + @classmethod + @_pathguard + def set_xtime_remote(cls, path, uuid, mark): + """ + set @mark as xtime for @uuid on @path + the difference b/w this and set_xtime() being + set_xtime() being overloaded to set the xtime + on the brick (this method sets xtime on the + remote slave) + """ + Xattr.lsetxattr(path, '.'.join([cls.GX_NSPACE, uuid, 'xtime']), struct.pack('!II', *mark)) + @classmethod def set_xtime_vec(cls, path, mark_dct): """vectored (or dictered) version of set_xtime -- cgit