diff options
author | Sunny Kumar <sunkumar@redhat.com> | 2019-04-02 12:38:09 +0530 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2019-04-26 07:15:00 +0000 |
commit | e7e89c9ec8b56ad5a442ad105c0b05e674a591cd (patch) | |
tree | de39656718e6234080c6df59c9522bfd22749635 /geo-replication/syncdaemon/resource.py | |
parent | a9143223c515b82f6382f1372dfbdc0439dba198 (diff) |
geo-rep: Fix rename with existing destination with same gfid
Problem:
Geo-rep fails to sync the rename properly if destination exists.
It results in source to be remained on slave causing more number of
files on slave. Also heavy rename workload like logrotate caused
lot of ESTALE errors
Cause:
Geo-rep fails to sync rename if destination exists if creation
of source file also falls into single batch of changelogs being
processed. This is because, after fixing problematic gfids verifying
from master, while re-processing original entries, CREATE also was
re-processed causing more files on slave and rename to be failed.
Solution:
Entries need to be removed from retrial list after fixing
problematic gfids on slave so that it's not re-created again on slave.
Also treat ESTALE as EEXIST so that the error is properly handled
verifying the op on master volume.
Change-Id: I50cf289e06b997adddff0552bf2466d9201dd1f9
fixes: bz#1694820
Signed-off-by: Kotresh HR <khiremat@redhat.com>
Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
Diffstat (limited to 'geo-replication/syncdaemon/resource.py')
-rw-r--r-- | geo-replication/syncdaemon/resource.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/geo-replication/syncdaemon/resource.py b/geo-replication/syncdaemon/resource.py index c290d86880e..f54ccd9441e 100644 --- a/geo-replication/syncdaemon/resource.py +++ b/geo-replication/syncdaemon/resource.py @@ -426,7 +426,7 @@ class Server(object): e['stat']['uid'] = uid e['stat']['gid'] = gid - if cmd_ret == EEXIST: + if cmd_ret in [EEXIST, ESTALE]: if dst: en = e['entry1'] else: @@ -510,6 +510,12 @@ class Server(object): entry = e['entry'] uid = 0 gid = 0 + + # Skip entry processing if it's marked true during gfid + # conflict resolution + if e['skip_entry']: + continue + if e.get("stat", {}): # Copy UID/GID value and then reset to zero. Copied UID/GID # will be used to run chown once entry is created. @@ -688,7 +694,7 @@ class Server(object): if blob: cmd_ret = errno_wrap(Xattr.lsetxattr, [pg, 'glusterfs.gfid.newfile', blob], - [EEXIST, ENOENT], + [EEXIST, ENOENT, ESTALE], [ESTALE, EINVAL, EBUSY]) collect_failure(e, cmd_ret, uid, gid) |