summaryrefslogtreecommitdiffstats
path: root/geo-replication/syncdaemon/resource.py
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2017-03-17 13:03:57 -0400
committerVijay Bellur <vbellur@redhat.com>2017-03-19 23:33:36 -0400
commite2a652ca6ba56235e6d64bf7df110afdc5f6ca27 (patch)
tree543703ded623cca89254a9b2ecc5ba03785e8f52 /geo-replication/syncdaemon/resource.py
parent78222bff29f27fc3b4f500ff2f7bd323c418d09e (diff)
geo-rep: Optionally allow access to mounts
In order to improve debuggability, it is important to have access to geo-rep master and slave mounts. With the default behaviour, geo-rep lazy unmounts the mounts after changing the current working directory into the mount point. It also cleans up the mount points. So only geo-rep worker has the access and it becomes impossible to take the client profile info and do any other client statck analysis. Hence the following new config is being introduced to allow access to mounts. gluster vol geo-rep <mastervol> <slavehost>::<slavevol> \ config access_mount true The default value of 'access_mount' is false. Change-Id: I53dce4ea86a6ffc979c82f9330e8954327180ca3 BUG: 1433506 Signed-off-by: Kotresh HR <khiremat@redhat.com> Reviewed-on: https://review.gluster.org/16912 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'geo-replication/syncdaemon/resource.py')
-rw-r--r--geo-replication/syncdaemon/resource.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/geo-replication/syncdaemon/resource.py b/geo-replication/syncdaemon/resource.py
index 977496318da..306742e53fc 100644
--- a/geo-replication/syncdaemon/resource.py
+++ b/geo-replication/syncdaemon/resource.py
@@ -41,6 +41,7 @@ from syncdutils import get_changelog_log_level
from syncdutils import CHANGELOG_AGENT_CLIENT_VERSION
from gsyncdstatus import GeorepStatus
from syncdutils import get_master_and_slave_data_from_args
+from syncdutils import mntpt_list
UrlRX = re.compile('\A(\w+)://([^ *?[]*)\Z')
HostRX = re.compile('[a-zA-Z\d](?:[a-zA-Z\d.-]*[a-zA-Z\d])?', re.I)
@@ -1014,6 +1015,8 @@ class SlaveRemote(object):
extra_opts += ['--local-node', ln]
if boolify(gconf.use_rsync_xattrs):
extra_opts.append('--use-rsync-xattrs')
+ if boolify(gconf.access_mount):
+ extra_opts.append('--access-mount')
po = Popen(rargs + gconf.remote_gsyncd.split() + extra_opts +
['-N', '--listen', '--timeout', str(gconf.timeout),
slave],
@@ -1373,13 +1376,14 @@ class GLUSTER(AbstractUrl, SlaveLocal, SlaveRemote):
assert(mntdata[-1] == '\0')
mntpt = mntdata[:-1]
assert(mntpt)
- if mounted:
+ if mounted and not boolify(gconf.access_mount):
po = self.umount_l(mntpt)
po.terminate_geterr(fail_on_err=False)
if po.returncode != 0:
po.errlog()
rv = po.returncode
- self.cleanup_mntpt(mntpt)
+ if not boolify(gconf.access_mount):
+ self.cleanup_mntpt(mntpt)
except:
logging.exception('mount cleanup failure:')
rv = 200
@@ -1399,6 +1403,7 @@ class GLUSTER(AbstractUrl, SlaveLocal, SlaveRemote):
def make_mount_argv(self):
self.mntpt = tempfile.mkdtemp(prefix='gsyncd-aux-mount-')
+ mntpt_list.append(self.mntpt)
return [self.get_glusterprog()] + \
['--' + p for p in self.params] + [self.mntpt]