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 <vbellur@redhat.com>2012-07-19 10:16:12 -0700
commitaa9f47d1729f6a7f08aef4c23d44febe498bb280 (patch)
tree4065f3b040ead93ad42a18edcd8c80456d3c1d5b /xlators/features/marker/utils
parentde22a7760db69b82de8959d238fe444af8b387d0 (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)