summaryrefslogtreecommitdiffstats
path: root/xlators/features/marker/utils
diff options
context:
space:
mode:
authorCsaba Henk <csaba@redhat.com>2012-07-18 04:07:20 +0200
committerVijay Bellur <vijay@gluster.com>2012-07-19 22:53:47 +0530
commit7dbd549be94d7041d2fa8df6f6357db6e492358b (patch)
tree5545e00bd356cf5ea02ea2c0a40a7c6ce9de08b3 /xlators/features/marker/utils
parentd7ed72f23b6bdff6b71359536952de72bb923ffa (diff)
geo-rep / gsyncd: convert ignore-deletes to a mixin too
Change-Id: I164a1d1dd5f15569afd6806834119a6844949df0 BUG: 841062 Signed-off-by: Csaba Henk <csaba@redhat.com> Reviewed-on: http://review.gluster.com/3684 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/features/marker/utils')
-rw-r--r--xlators/features/marker/utils/syncdaemon/master.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/xlators/features/marker/utils/syncdaemon/master.py b/xlators/features/marker/utils/syncdaemon/master.py
index a6aeb53dce0..ef3816e6519 100644
--- a/xlators/features/marker/utils/syncdaemon/master.py
+++ b/xlators/features/marker/utils/syncdaemon/master.py
@@ -60,7 +60,8 @@ def gmaster_builder():
logging.info('setting up master for %s sync mode' % modemixin)
modemixin = getattr(this, modemixin.capitalize() + 'Mixin')
sendmarkmixin = boolify(gconf.use_rsync_xattrs) and SendmarkNormalMixin or SendmarkRsyncMixin
- class _GMaster(GMasterBase, modemixin, sendmarkmixin):
+ purgemixin = boolify(gconf.ignore_deletes) and PurgeNoopMixin or PurgeNormalMixin
+ class _GMaster(GMasterBase, modemixin, sendmarkmixin, purgemixin):
pass
return _GMaster
@@ -309,6 +310,18 @@ class SendmarkRsyncMixin(object):
pass
+class PurgeNormalMixin(object):
+
+ def purge_missing(self, path, names):
+ self.slave.server.purge(path, dd)
+
+class PurgeNoopMixin(object):
+
+ def purge_missing(self, path, names):
+ pass
+
+
+
class GMasterBase(object):
"""abstract class impementling master role"""
@@ -728,8 +741,8 @@ class GMasterBase(object):
self.add_failjob(path, 'remote-entries-fail')
return
dd = set(des) - set(dem)
- if dd and not boolify(gconf.ignore_deletes):
- self.slave.server.purge(path, dd)
+ if dd:
+ self.purge_missing(path, dd)
chld = []
for e in dem:
e = os.path.join(path, e)