summaryrefslogtreecommitdiffstats
path: root/geo-replication/syncdaemon/resource.py
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2018-02-12 03:11:04 -0500
committerKotresh HR <khiremat@redhat.com>2018-02-22 05:40:35 +0000
commite4ca0b3df379c553e220f929f0203175bd536b61 (patch)
treeb4e673999ea45bf1a5370015e19d5241bf4aa965 /geo-replication/syncdaemon/resource.py
parent961370d995400b68afe520207593b8cc59846448 (diff)
geo-rep: Remove lazy umount and use mount namespaces
Lazy umounting the master volume by worker causes issues with rsync's usage of getcwd. Henc removing the lazy umount and using private mount namespace for the same. On the slave, the lazy umount is retained as we can't use private namespace in non root geo-rep setup. Change-Id: I403375c02cb3cc7d257a5f72bbdb5118b4c8779a BUG: 1546129 Signed-off-by: Kotresh HR <khiremat@redhat.com>
Diffstat (limited to 'geo-replication/syncdaemon/resource.py')
-rw-r--r--geo-replication/syncdaemon/resource.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/geo-replication/syncdaemon/resource.py b/geo-replication/syncdaemon/resource.py
index 2d48a28c145..8f17e00fb2d 100644
--- a/geo-replication/syncdaemon/resource.py
+++ b/geo-replication/syncdaemon/resource.py
@@ -38,7 +38,7 @@ from syncdutils import get_changelog_log_level, get_rsync_version
from syncdutils import CHANGELOG_AGENT_CLIENT_VERSION
from syncdutils import GX_GFID_CANONICAL_LEN
from gsyncdstatus import GeorepStatus
-from syncdutils import mntpt_list, lf, Popen, sup, Volinfo
+from syncdutils import lf, Popen, sup, Volinfo
from syncdutils import Xattr, matching_disk_gfid, get_gfid_from_mnt
@@ -804,6 +804,7 @@ class Mounter(object):
def __init__(self, params):
self.params = params
self.mntpt = None
+ self.umount_cmd = []
@classmethod
def get_glusterprog(cls):
@@ -838,10 +839,6 @@ class Mounter(object):
change into the mount, and lazy unmount the
filesystem.
"""
- access_mount = gconf.get("access-mount")
- if rconf.args.subcmd == "slave":
- access_mount = gconf.get("slave-access-mount")
-
mpi, mpo = os.pipe()
mh = Popen.fork()
if mh:
@@ -903,13 +900,15 @@ class Mounter(object):
assert(mntdata[-1] == '\0')
mntpt = mntdata[:-1]
assert(mntpt)
- if mounted and not access_mount:
+ if mounted and rconf.args.subcmd == "slave" \
+ and not gconf.get("slave-access-mount"):
po = self.umount_l(mntpt)
po.terminate_geterr(fail_on_err=False)
if po.returncode != 0:
po.errlog()
rv = po.returncode
- if not access_mount:
+ if rconf.args.subcmd == "slave" \
+ and not gconf.get("slave-access-mount"):
self.cleanup_mntpt(mntpt)
except:
logging.exception('mount cleanup failure:')
@@ -931,7 +930,7 @@ class DirectMounter(Mounter):
def make_mount_argv(self, label=None):
self.mntpt = tempfile.mkdtemp(prefix='gsyncd-aux-mount-')
- mntpt_list.append(self.mntpt)
+ rconf.mount_point = self.mntpt
return [self.get_glusterprog()] + \
['--' + p for p in self.params] + [self.mntpt]
@@ -964,6 +963,10 @@ class MountbrokerMounter(Mounter):
def handle_mounter(self, po):
self.mntpt = po.stdout.readline()[:-1]
+ rconf.mount_point = self.mntpt
+ rconf.mountbroker = True
+ self.umount_cmd = self.make_cli_argv() + ['umount']
+ rconf.mbr_umount_cmd = self.umount_cmd
po.stdout.close()
sup(self, po)
if po.returncode != 0: