diff options
| author | Sunny Kumar <sunkumar@redhat.com> | 2019-01-14 11:48:55 +0530 | 
|---|---|---|
| committer | Kotresh HR <khiremat@redhat.com> | 2019-01-17 10:13:52 +0000 | 
| commit | 11cf73bc4173c13a9de54ea8d816eb72d8b01f48 (patch) | |
| tree | 53c5ccf88da19ac09efeae927dc065e932d5f5bb /geo-replication/syncdaemon/syncdutils.py | |
| parent | 0301a66bda44582e3a48519f2a5d365b0c38090d (diff) | |
geo-rep : fix rename sync on hybrid crawl
Problem: When geo-rep is configured as hybrid crawl
         directory renames are not synced to the slave.
Solution: Rename sync of directory was failing due to incorrect
          destination path calculation.
          During check for existence on slave we miscalculated
          realpath. <host:brickpath/dir>.
Change-Id: I23f1ea60e86a917598fe869d5d24f8da654d8a0a
fixes: bz#1665826
Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
Diffstat (limited to 'geo-replication/syncdaemon/syncdutils.py')
| -rw-r--r-- | geo-replication/syncdaemon/syncdutils.py | 22 | 
1 files changed, 9 insertions, 13 deletions
diff --git a/geo-replication/syncdaemon/syncdutils.py b/geo-replication/syncdaemon/syncdutils.py index fd96ca70b2f..2d1e107eec1 100644 --- a/geo-replication/syncdaemon/syncdutils.py +++ b/geo-replication/syncdaemon/syncdutils.py @@ -683,19 +683,15 @@ def get_slv_dir_path(slv_host, slv_volume, gfid):                                 gfid[2:4],                                 gfid], [ENOENT], [ESTALE])          if dir_path != ENOENT: -            break - -    if not isinstance(dir_path, int): -        realpath = errno_wrap(os.readlink, [dir_path], -                              [ENOENT], [ESTALE]) - -        if not isinstance(realpath, int): -            realpath_parts = realpath.split('/') -            pargfid = realpath_parts[-2] -            basename = realpath_parts[-1] -            pfx = gauxpfx() -            dir_entry = os.path.join(pfx, pargfid, basename) -            return dir_entry +            realpath = errno_wrap(os.readlink, [dir_path], +                                  [ENOENT], [ESTALE]) +            if not isinstance(realpath, int): +                realpath_parts = realpath.split('/') +                pargfid = realpath_parts[-2] +                basename = realpath_parts[-1] +                pfx = gauxpfx() +                dir_entry = os.path.join(pfx, pargfid, basename) +                return dir_entry      return None  | 
