summaryrefslogtreecommitdiffstats
path: root/geo-replication
diff options
context:
space:
mode:
authorVenky Shankar <vshankar@redhat.com>2013-07-31 19:40:28 +0530
committerAnand Avati <avati@redhat.com>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 <vshankar@redhat.com> Reviewed-on: http://review.gluster.org/5451 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Avra Sengupta <asengupt@redhat.com> Tested-by: Avra Sengupta <asengupt@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'geo-replication')
-rw-r--r--geo-replication/syncdaemon/master.py1
-rw-r--r--geo-replication/syncdaemon/resource.py12
2 files changed, 13 insertions, 0 deletions
diff --git a/geo-replication/syncdaemon/master.py b/geo-replication/syncdaemon/master.py
index 58df14954bb..12eadb1073a 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 297cdabcb79..1010247aed1 100644
--- a/geo-replication/syncdaemon/resource.py
+++ b/geo-replication/syncdaemon/resource.py
@@ -432,6 +432,18 @@ class Server(object):
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