diff options
author | Ravishankar N <ravishankar@redhat.com> | 2018-10-11 07:22:09 +0530 |
---|---|---|
committer | Shyamsundar Ranganathan <srangana@redhat.com> | 2018-10-11 11:00:02 +0000 |
commit | 34e8058b7c8e906c889d6d0e155ea63037148eea (patch) | |
tree | 5db4c381ea96750b9c22d4b3f9e9e9779e4730fc /xlators/cluster/afr/src/afr-common.c | |
parent | c7b933bc460bf47a8d4404055bf1a52225a138cb (diff) |
afr: fix incorrect reporting of directory split-brain
Backport of https://review.gluster.org/#/c/glusterfs/+/21135/
Problem:
When a directory has dirty xattrs due to failed post-ops or when
replace/reset brick is performed, AFR does a conservative merge as
expected, but heal-info reports it as split-brain because there are no
clear sources.
Fix:
Modify pending flag to contain information about pending heals and
split-brains. For directories, if spit-brain flag is not set,just show
them as needing heal and not being in split-brain.
Change-Id: I09ef821f6887c87d315ae99e6b1de05103cd9383
fixes: bz#1638163
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-common.c')
-rw-r--r-- | xlators/cluster/afr/src/afr-common.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c index eb0e7330a91..0fdbde42779 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -5814,7 +5814,7 @@ out: int afr_selfheal_locked_metadata_inspect(call_frame_t *frame, xlator_t *this, inode_t *inode, gf_boolean_t *msh, - gf_boolean_t *pending) + unsigned char *pending) { int ret = -1; unsigned char *locked_on = NULL; @@ -5859,7 +5859,7 @@ out: int afr_selfheal_locked_data_inspect(call_frame_t *frame, xlator_t *this, fd_t *fd, - gf_boolean_t *dsh, gf_boolean_t *pflag) + gf_boolean_t *dsh, unsigned char *pflag) { int ret = -1; unsigned char *data_lock = NULL; @@ -5903,7 +5903,7 @@ out: int afr_selfheal_locked_entry_inspect(call_frame_t *frame, xlator_t *this, inode_t *inode, gf_boolean_t *esh, - gf_boolean_t *pflag) + unsigned char *pflag) { int ret = -1; int source = -1; @@ -5952,7 +5952,7 @@ afr_selfheal_locked_entry_inspect(call_frame_t *frame, xlator_t *this, ret = __afr_selfheal_entry_prepare(frame, this, inode, data_lock, sources, sinks, healed_sinks, locked_replies, &source, pflag); - if ((ret == 0) && source < 0) + if ((ret == 0) && (*pflag & PFLAG_SBRAIN)) ret = -EIO; *esh = afr_decide_heal_info(priv, sources, ret); } @@ -5974,7 +5974,7 @@ afr_selfheal_locked_inspect(call_frame_t *frame, xlator_t *this, uuid_t gfid, inode_t **inode, gf_boolean_t *entry_selfheal, gf_boolean_t *data_selfheal, gf_boolean_t *metadata_selfheal, - gf_boolean_t *pending) + unsigned char *pending) { int ret = -1; @@ -6059,7 +6059,7 @@ afr_get_heal_info(call_frame_t *frame, xlator_t *this, loc_t *loc) gf_boolean_t data_selfheal = _gf_false; gf_boolean_t metadata_selfheal = _gf_false; gf_boolean_t entry_selfheal = _gf_false; - gf_boolean_t pending = _gf_false; + unsigned char pending = _gf_false; dict_t *dict = NULL; int ret = -1; int op_errno = 0; @@ -6077,7 +6077,7 @@ afr_get_heal_info(call_frame_t *frame, xlator_t *this, loc_t *loc) goto out; } - if (pending) { + if (pending & PFLAG_PENDING) { gf_asprintf(&substr, "-pending"); if (!substr) goto out; |