summaryrefslogtreecommitdiffstats
path: root/geo-replication/syncdaemon/resource.py
diff options
context:
space:
mode:
authorAravinda VK <avishwan@redhat.com>2015-01-28 17:19:42 +0530
committerVijay Bellur <vbellur@redhat.com>2015-03-02 02:05:45 -0800
commit1455ee40030c8d3c4818ba7d7ca8ca851e12b848 (patch)
treeb78037e6b9ec279d8453946d7620f5ec19ce032f /geo-replication/syncdaemon/resource.py
parentc3e6d6b54741cfbc828272ace576339ae3a37173 (diff)
geo-rep: Add support for xattrs
This patch adds support for xattrs. When it sees SETXATTR in Changelog, it adds the file to data queue. rsync/tar+ssh will take care of syncing xattrs. User set xattrs will be synced to Slave. New config interface is introduced, sync-xattrs Which can be set using geo-rep config(Default is True) gluster volume geo-replication <VOLUME> <SLAVEHOST>::<SLAVEVOL> \ config sync-xattrs false Change-Id: I70626d854a0d616469dd54d61e5ef155ed8b67d8 BUG: 1196690 Signed-off-by: Aravinda VK <avishwan@redhat.com> Reviewed-on: http://review.gluster.org/9499 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kotresh HR <khiremat@redhat.com> Reviewed-by: Saravanakumar Arumugam <sarumuga@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'geo-replication/syncdaemon/resource.py')
-rw-r--r--geo-replication/syncdaemon/resource.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/geo-replication/syncdaemon/resource.py b/geo-replication/syncdaemon/resource.py
index 0e0dd88eff8..e9796fc48f6 100644
--- a/geo-replication/syncdaemon/resource.py
+++ b/geo-replication/syncdaemon/resource.py
@@ -830,7 +830,7 @@ class SlaveRemote(object):
['-avR0', '--inplace', '--files-from=-', '--super',
'--stats', '--numeric-ids', '--no-implied-dirs'] + \
gconf.rsync_options.split() + \
- (boolify(gconf.use_rsync_xattrs) and ['--xattrs'] or []) + \
+ (boolify(gconf.sync_xattrs) and ['--xattrs'] or []) + \
['.'] + list(args)
po = Popen(argv, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
for f in files:
@@ -852,9 +852,13 @@ class SlaveRemote(object):
raise GsyncdError("no files to sync")
logging.debug("files: " + ", ".join(files))
(host, rdir) = slaveurl.split(':')
- tar_cmd = ["tar", "-cf", "-", "--files-from", "-"]
+ tar_cmd = ["tar"] + \
+ (boolify(gconf.sync_xattrs) and ['--xattrs'] or []) + \
+ ["-cf", "-", "--files-from", "-"]
ssh_cmd = gconf.ssh_command_tar.split() + \
- [host, "tar", "--overwrite", "-xf", "-", "-C", rdir]
+ [host, "tar"] + \
+ (boolify(gconf.sync_xattrs) and ['--xattrs'] or []) + \
+ ["--overwrite", "-xf", "-", "-C", rdir]
p0 = Popen(tar_cmd, stdout=subprocess.PIPE,
stdin=subprocess.PIPE, stderr=subprocess.PIPE)
p1 = Popen(ssh_cmd, stdin=p0.stdout, stderr=subprocess.PIPE)