summaryrefslogtreecommitdiffstats
path: root/geo-replication/syncdaemon
diff options
context:
space:
mode:
authorSunny Kumar <sunkumar@redhat.com>2020-05-19 16:13:01 +0100
committerSunny Kumar <sunkumar@redhat.com>2020-07-07 10:53:02 +0000
commit27f5c8ba844e9da54fc1304df4ffe015a3bbb9bd (patch)
tree8a5fabe98147ab6c0353ef2236a4cd6ea7532699 /geo-replication/syncdaemon
parente6e930013636e0bff7c04061bf6370d71ca4dac6 (diff)
geo-rep: Fix corner case in rename on mkdir during hybrid crawl
Problem: The issue is being hit during hybrid mode while handling rename on slave. In this special case the rename is recorded as mkdir and geo-rep process it by resolving the path form backend. While resolving the backend path during this special handling one corner case is not considered. <snip> Traceback (most recent call last):   File "/usr/libexec/glusterfs/python/syncdaemon/repce.py", line 118, in worker     res = getattr(self.obj, rmeth)(*in_data[2:])   File "/usr/libexec/glusterfs/python/syncdaemon/resource.py", line 588, in entry_ops     src_entry = get_slv_dir_path(slv_host, slv_volume, gfid)   File "/usr/libexec/glusterfs/python/syncdaemon/syncdutils.py", line 710, in get_slv_dir_path     dir_entry = os.path.join(pfx, pargfid, basename)   File "/usr/lib64/python2.7/posixpath.py", line 75, in join     if b.startswith('/'): AttributeError: 'int' object has no attribute 'startswith' In pyhthon3: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib64/python3.8/posixpath.py", line 90, in join genericpath._check_arg_types('join', a, *p) File "/usr/lib64/python3.8/genericpath.py", line 152, in _check_arg_types raise TypeError(f'{funcname}() argument must be str, bytes, or ' TypeError: join() argument must be str, bytes, or os.PathLike object, not 'int' </snip> Change-Id: I8b926899c60ad8c4ffc886d57028ba70fd21e332 Fixes: #1250 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
Diffstat (limited to 'geo-replication/syncdaemon')
-rw-r--r--geo-replication/syncdaemon/syncdutils.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/geo-replication/syncdaemon/syncdutils.py b/geo-replication/syncdaemon/syncdutils.py
index 345339a787c..6362c13d5e3 100644
--- a/geo-replication/syncdaemon/syncdutils.py
+++ b/geo-replication/syncdaemon/syncdutils.py
@@ -730,6 +730,8 @@ def get_slv_dir_path(slv_host, slv_volume, gfid):
else:
dirpath = dirpath.strip("/")
pargfid = get_gfid_from_mnt(dirpath)
+ if isinstance(pargfid, int):
+ return None
dir_entry = os.path.join(pfx, pargfid, basename)
return dir_entry