diff options
author | Sunny Kumar <sunkumar@redhat.com> | 2020-05-19 16:13:01 +0100 |
---|---|---|
committer | Rinku Kothiya <rkothiya@redhat.com> | 2020-08-19 18:07:28 +0000 |
commit | 4be26c88732f55b38da171c86334eddbdaac5c14 (patch) | |
tree | a4b06f65f8e74f70fd7e6d97b1d5fa18d786bb34 | |
parent | 269ece312c9fd890c74c46e79de70efe1720752c (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>
Backport of:
>Ptach link: https://review.gluster.org/#/c/glusterfs/+/24468/
>Change-Id: I8b926899c60ad8c4ffc886d57028ba70fd21e332
>Fixes: #1250
>Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
Change-Id: I8b926899c60ad8c4ffc886d57028ba70fd21e332
Fixes: #1250
Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
(cherry picked from commit 27f5c8ba844e9da54fc1304df4ffe015a3bbb9bd)
Change-Id: I171eb9ad4e30f49cfe86cb258918682d3c0f5af9
-rw-r--r-- | geo-replication/syncdaemon/syncdutils.py | 2 |
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 |