summaryrefslogtreecommitdiffstats
path: root/geo-replication/syncdaemon
diff options
context:
space:
mode:
authorVenky Shankar <vshankar@redhat.com>2013-08-07 16:10:25 +0530
committerAnand Avati <avati@redhat.com>2013-09-04 20:42:31 -0700
commit9ccdba413ff12956df2221fce91b220300479d23 (patch)
tree9b1ae49555f53c9cc9164661268f8ab3c1cb43e0 /geo-replication/syncdaemon
parent07bb6118677119fd21ff38d51b4cefd06c0ad35a (diff)
gsyncd / geo-rep: introduce "recovery" mode
This mode introduces and optimized recovery of master, used during failover-failback cases. Files are only transferred if they are identified as changed on the slave. A normal failback mechanism would be just to reverse the direction of geo-replication syncing. Doing this is the correct way but could be time consuming. "Recovery" mode optimizes this by identifying files (as skipping them) duing the one-shot crawl. NOTE: Use this mode when you are _absolutely_ sure that the namespace on the master is intact, ie. there is number of files in master is equal to the number of files in the slave, but the slave was written to (after a failover) when master was brought back up. - gluster volume geo <MV> <SLAVE>::<SV> config special_sync_mode recover - gluster volume geo <MV> <SLAVE>::<SV> start Change-Id: Idb698949e4e86698b15d04a35d33095562f51714 BUG: 994462 Original Author: Venky Shankar <vshankar@redhat.com> Signed-off-by: Venky Shankar <vshankar@redhat.com> Reviewed-on: http://review.gluster.org/5515 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/syncdaemon')
-rw-r--r--geo-replication/syncdaemon/master.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/geo-replication/syncdaemon/master.py b/geo-replication/syncdaemon/master.py
index 3b093677af8..a19fe264419 100644
--- a/geo-replication/syncdaemon/master.py
+++ b/geo-replication/syncdaemon/master.py
@@ -157,6 +157,23 @@ class PartialMixin(NormalMixin):
def xtime_reversion_hook(self, path, xtl, xtr):
pass
+class RecoverMixin(NormalMixin):
+ """a variant that differs from normal in terms
+ of ignoring non-indexed files"""
+
+ @staticmethod
+ def make_xtime_opts(is_master, opts):
+ if not 'create' in opts:
+ opts['create'] = False
+ if not 'default_xtime' in opts:
+ opts['default_xtime'] = URXTIME
+
+ def keepalive_payload_hook(self, timo, gap):
+ return (None, gap)
+
+ def volinfo_hook(self):
+ return _volinfo_hook_relax_foreign(self)
+
# Further mixins for certain tunable behaviors
class SendmarkNormalMixin(object):
@@ -797,7 +814,7 @@ class GMasterChangelogMixin(GMasterCommon):
self.turns += 1
def upd_stime(self, stime):
- if stime:
+ if not stime == URXTIME:
self.sendmark(self.FLAT_DIR_HIERARCHY, stime)
def crawl(self):