summaryrefslogtreecommitdiffstats
path: root/geo-replication/syncdaemon/syncdutils.py
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2018-06-07 04:11:25 -0400
committerKotresh HR <khiremat@redhat.com>2018-08-16 00:20:47 -0400
commit050969fb3cfb176fa206d3ae8169d6021879d9db (patch)
tree96b6b37b145611e9b788440ba2c0364615c0a05f /geo-replication/syncdaemon/syncdutils.py
parent03aed04ac00e7985c7891a532d7c59a0a4c547ed (diff)
geo-rep: Fix geo-rep for older versions of unshare
Geo-rep mounts are private to worker. It uses mount namespace using unshare command to achieve the same. Well, the unshare command has to support '--propagation' option. So geo-rep breaks on the systems with older unshare version. The patch makes it fall back to lazy umount behaviour if the unshare does not support propagation option. Backport of: > BUG: 1589782 > Change-Id: Ia614f068aede288d63ac62fea4461b1865066054 > Signed-off-by: Kotresh HR <khiremat@redhat.com> fixes: bz#1611111 Change-Id: Ia614f068aede288d63ac62fea4461b1865066054 Signed-off-by: Kotresh HR <khiremat@redhat.com>
Diffstat (limited to 'geo-replication/syncdaemon/syncdutils.py')
-rw-r--r--geo-replication/syncdaemon/syncdutils.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/geo-replication/syncdaemon/syncdutils.py b/geo-replication/syncdaemon/syncdutils.py
index 1e40ff56858..ad923c3a53b 100644
--- a/geo-replication/syncdaemon/syncdutils.py
+++ b/geo-replication/syncdaemon/syncdutils.py
@@ -62,6 +62,7 @@ CHANGELOG_AGENT_SERVER_VERSION = 1.0
CHANGELOG_AGENT_CLIENT_VERSION = 1.0
NodeID = None
rsync_version = None
+unshare_mnt_propagation = None
SPACE_ESCAPE_CHAR = "%20"
NEWLINE_ESCAPE_CHAR = "%0A"
PERCENTAGE_ESCAPE_CHAR = "%25"
@@ -623,6 +624,22 @@ def get_master_and_slave_data_from_args(args):
return (master_name, slave_data)
+def unshare_propagation_supported():
+ global unshare_mnt_propagation
+ if unshare_mnt_propagation is not None:
+ return unshare_mnt_propagation
+
+ unshare_mnt_propagation = False
+ p = subprocess.Popen(["unshare", "--help"],
+ stderr=subprocess.PIPE,
+ stdout=subprocess.PIPE)
+ out, err = p.communicate()
+ if p.returncode == 0:
+ if "propagation" in out:
+ unshare_mnt_propagation = True
+
+ return unshare_mnt_propagation
+
def get_rsync_version(rsync_cmd):
global rsync_version