path: root/geo-replication
diff options
authorVenky Shankar <>2013-07-31 19:40:28 +0530
committerAnand Avati <>2013-09-04 19:48:49 -0700
commitf0b92a45e5c757ec25257e389c877b9b0de8ed07 (patch)
treeed147c1252c9270db14664626af5a1954e803dd2 /geo-replication
parent1a642df1e963bf13d44de5b28a72ed2eb4dbca88 (diff)
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: Tested-by: Gluster Build System <> Reviewed-by: Avra Sengupta <> Tested-by: Avra Sengupta <> Reviewed-by: Anand Avati <>
Diffstat (limited to 'geo-replication')
2 files changed, 13 insertions, 0 deletions
diff --git a/geo-replication/syncdaemon/ b/geo-replication/syncdaemon/
index 58df14954..12eadb107 100644
--- a/geo-replication/syncdaemon/
+++ b/geo-replication/syncdaemon/
@@ -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/ b/geo-replication/syncdaemon/
index 297cdabcb..1010247ae 100644
--- a/geo-replication/syncdaemon/
+++ b/geo-replication/syncdaemon/
@@ -432,6 +432,18 @@ class Server(object):
Xattr.lsetxattr(path, '.'.join([cls.GX_NSPACE, uuid, 'xtime']), struct.pack('!II', *mark))
+ @_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