diff options
author | Ravishankar N <ravishankar@redhat.com> | 2018-09-27 17:26:52 +0530 |
---|---|---|
committer | jiffin tony Thottan <jthottan@redhat.com> | 2018-10-10 05:20:42 +0000 |
commit | 76788178ba725442c95541e37e56d4a83da2bb78 (patch) | |
tree | 7650feadb7846b98c5399106e447b1eb54cfd652 /xlators/cluster/afr/src/afr-common.c | |
parent | ca5adfb65b08841714431e97751a0c0c63a4bbdf (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.
Fixes: bz#1633625
Change-Id: I09ef821f6887c87d315ae99e6b1de05103cd9383
BUG: 1633625
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 613f9d1db75..8ab7e24ae59 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -5700,7 +5700,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; @@ -5749,7 +5749,7 @@ out: int afr_selfheal_locked_data_inspect (call_frame_t *frame, xlator_t *this, inode_t *inode, gf_boolean_t *dsh, - gf_boolean_t *pflag) + unsigned char *pflag) { int ret = -1; unsigned char *data_lock = NULL; @@ -5810,7 +5810,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) + gf_boolean_t *esh, unsigned char *pflag) { int ret = -1; int source = -1; @@ -5861,7 +5861,7 @@ afr_selfheal_locked_entry_inspect (call_frame_t *frame, xlator_t *this, 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); } @@ -5884,7 +5884,7 @@ afr_selfheal_locked_inspect (call_frame_t *frame, xlator_t *this, uuid_t gfid, 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; @@ -5954,7 +5954,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 = 0; dict_t *dict = NULL; int ret = -1; int op_errno = 0; @@ -5974,7 +5974,7 @@ afr_get_heal_info (call_frame_t *frame, xlator_t *this, loc_t *loc) goto out; } - if (pending) { + if (pending & PFLAG_PENDING) { size = strlen ("-pending") + 1; gf_asprintf (&substr, "-pending"); if (!substr) |