Add support for sparse files to tarssh method

Without '--sparse' option tar will not properly archive sparse file
and geo-replication will result in non-sparse file on the remote end.

Here is more on how I arrived at this
http://markelov.org/wiki/index.php/GlusterFS_3.6.1_on_CentOS_6.5:_geo-replication_and_sparse_files_problem

Change-Id: I8d671964a1b48bbb916e4a064571221bf3631494
BUG: 1276839
Signed-off-by: Alex Markelov <alex@markelov.org>
Reviewed-on: http://review.gluster.org/12476
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Aravinda VK <avishwan@redhat.com>
This commit is contained in:
Alex Markelov 2015-10-31 08:30:08 +00:00 committed by Venky Shankar
parent ddf5957d3e
commit eff14863fb

View File

@ -958,7 +958,7 @@ class SlaveRemote(object):
logging.debug("files: " + ", ".join(files))
(host, rdir) = slaveurl.split(':')
tar_cmd = ["tar"] + \
["-cf", "-", "--files-from", "-"]
["--sparse", "-cf", "-", "--files-from", "-"]
ssh_cmd = gconf.ssh_command_tar.split() + \
["-p", str(gconf.ssh_port)] + \
[host, "tar"] + \