summaryrefslogtreecommitdiffstats
path: root/geo-replication/syncdaemon/monitor.py
diff options
context:
space:
mode:
authorMilind Changire <mchangir@redhat.com>2016-04-22 16:56:47 +0530
committerAravinda VK <avishwan@redhat.com>2016-07-21 03:04:23 -0700
commit301e4e8366759c45aaff03a7953ab5248b5f61de (patch)
tree2b69a9d7a7acdd9489ab485c795032d732944443 /geo-replication/syncdaemon/monitor.py
parent2526f9d3ddc3e7f62828ac4289001b22638ae42a (diff)
georep: add reset-sync-time option for session delete
Set the stime xattr at all the brick roots to (0,0) if the argument reset-sync-time has been provided on the command-line. To avoid testing against directory specific stime, the remote stime is assumed to be minus_infinity, if the root directory stime is set to (0,0), before the directory scan begins. This triggers a full volume resync to slave in the case of a geo-rep session recreation with the same master-slave volume pair. Command synopsis: gluster volume geo-replication <MASTERVOL> <SLAVE>::<SLAVEVOL> delete \ [reset-sync-time] Update gluster cli man page to include new sub-command reset-sync-time. Change-Id: Ie4ce03b9425ed9bb81eda8681058c0fc6f990948 BUG: 1357772 Signed-off-by: Milind Changire <mchangir@redhat.com> Reviewed-on: http://review.gluster.org/14051 Reviewed-by: Kotresh HR <khiremat@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Aravinda VK <avishwan@redhat.com> (cherry picked from commit 70fd68d94f768c098b3178c151fa92c5079a8cfd) Reviewed-on: http://review.gluster.org/14952
Diffstat (limited to 'geo-replication/syncdaemon/monitor.py')
-rw-r--r--geo-replication/syncdaemon/monitor.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/geo-replication/syncdaemon/monitor.py b/geo-replication/syncdaemon/monitor.py
index 050218b6d1b..a26de0c9cf5 100644
--- a/geo-replication/syncdaemon/monitor.py
+++ b/geo-replication/syncdaemon/monitor.py
@@ -165,6 +165,7 @@ class Volinfo(object):
else:
return 0
+
class Monitor(object):
"""class which spawns and manages gsyncd workers"""
@@ -428,6 +429,15 @@ def distribute(*resources):
suuid = svol.uuid
slave_host = slave.remote_addr.split('@')[-1]
slave_vol = si.volume
+
+ # save this xattr for the session delete command
+ old_stime_xattr_name = getattr(gconf, "master.stime_xattr_name", None)
+ new_stime_xattr_name = "trusted.glusterfs." + mvol.uuid + "." + \
+ svol.uuid + ".stime"
+ if not old_stime_xattr_name or \
+ old_stime_xattr_name != new_stime_xattr_name:
+ gconf.configinterface.set("master.stime_xattr_name",
+ new_stime_xattr_name)
else:
raise GsyncdError("unknown slave type " + slave.url)
logging.info('slave bricks: ' + repr(sbricks))