diff options
author | Aravinda VK <avishwan@redhat.com> | 2016-12-02 15:04:49 +0530 |
---|---|---|
committer | Aravinda VK <avishwan@redhat.com> | 2017-05-23 11:15:47 +0000 |
commit | 02979e4663ea9e8a925f785f206d1dba02f253c4 (patch) | |
tree | d155a570877ed1bffa056776470a971ef18af545 /geo-replication/syncdaemon/resource.py | |
parent | acf8cc3a2283d209337ba9f5da6b03396daac359 (diff) |
geo-rep: Rsync tunables for performance improvements
Flag: --ignore-missing-args
This Rsync flag reduces sync failures if the source file is
unlinked but present in --files-from list. This reduces
Rsync retries in Geo-rep and improves the performance
Flag: --existing
Rsync in Geo-rep never creates target files. Using RPC Geo-rep creates
entry in Slave and rsync --inplace used to prevent creating temporary file
and rename.(To avoid different GFID in Slave). If the entry is missing in
Slave then Geo-rep Rsync gets Permission denied errors when it tries to
create file with name as GFID inside .gfid dir.(Geo-rep rsync syncs data
using GFIDS with aux-gfid-mount)
To disable these flags,
gluster volume geo-replication <session> config \
rsync-opt-ignore-missing-args false
gluster volume geo-replication <session> config \
rsync-opt-existing false
Thanks Kotresh for finding these awesome tunables.
BUG: 1400924
Change-Id: I6a84fb86a589bf6edc8dfd1086456a84b05a64fc
Signed-off-by: Aravinda VK <avishwan@redhat.com>
Reviewed-on: https://review.gluster.org/16010
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Kotresh HR <khiremat@redhat.com>
Diffstat (limited to 'geo-replication/syncdaemon/resource.py')
-rw-r--r-- | geo-replication/syncdaemon/resource.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/geo-replication/syncdaemon/resource.py b/geo-replication/syncdaemon/resource.py index 2fb6d5f1cdf..9cbe92a93c5 100644 --- a/geo-replication/syncdaemon/resource.py +++ b/geo-replication/syncdaemon/resource.py @@ -37,7 +37,7 @@ from syncdutils import GsyncdError, select, privileged, boolify, funcode from syncdutils import umask, entry2pb, gauxpfx, errno_wrap, lstat from syncdutils import NoStimeAvailable, PartialHistoryAvailable from syncdutils import ChangelogException, ChangelogHistoryNotAvailable -from syncdutils import get_changelog_log_level +from syncdutils import get_changelog_log_level, get_rsync_version from syncdutils import CHANGELOG_AGENT_CLIENT_VERSION from gsyncdstatus import GeorepStatus from syncdutils import get_master_and_slave_data_from_args @@ -1050,12 +1050,22 @@ class SlaveRemote(object): if not files: raise GsyncdError("no files to sync") logging.debug("files: " + ", ".join(files)) + + extra_rsync_flags = [] + # Performance flag, --ignore-missing-args, if rsync version is + # greater than 3.1.0 then include this flag. + if boolify(gconf.rsync_opt_ignore_missing_args) and \ + get_rsync_version(gconf.rsync_command) >= "3.1.0": + extra_rsync_flags = ["--ignore-missing-args"] + argv = gconf.rsync_command.split() + \ ['-aR0', '--inplace', '--files-from=-', '--super', '--stats', '--numeric-ids', '--no-implied-dirs'] + \ + (boolify(gconf.rsync_opt_existing) and ['--existing'] or []) + \ gconf.rsync_options.split() + \ (boolify(gconf.sync_xattrs) and ['--xattrs'] or []) + \ (boolify(gconf.sync_acls) and ['--acls'] or []) + \ + extra_rsync_flags + \ ['.'] + list(args) log_rsync_performance = boolify(gconf.configinterface.get_realtime( |