diff options
author | Ravishankar N <ravishankar@redhat.com> | 2018-09-20 10:14:26 +0530 |
---|---|---|
committer | Shyamsundar Ranganathan <srangana@redhat.com> | 2018-09-21 16:35:26 +0000 |
commit | 9d8f5a34c1ff4ae512f80fe9651508ae201c273e (patch) | |
tree | 32c54faf293bc707280820a11c8bd8c7cbfe5a9f /xlators/cluster/afr/src/afr-self-heal-common.c | |
parent | d901308a06c38fa53a3b07ed1641522a3248378d (diff) |
afr: fix incorrect reporting of directory split-brain
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#1626994
Change-Id: I09ef821f6887c87d315ae99e6b1de05103cd9383
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal-common.c')
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-common.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c index c48c47683c3..402f5ea5888 100644 --- a/xlators/cluster/afr/src/afr-self-heal-common.c +++ b/xlators/cluster/afr/src/afr-self-heal-common.c @@ -1513,7 +1513,7 @@ afr_selfheal_find_direction(call_frame_t *frame, xlator_t *this, struct afr_reply *replies, afr_transaction_type type, unsigned char *locked_on, unsigned char *sources, unsigned char *sinks, - uint64_t *witness, gf_boolean_t *pflag) + uint64_t *witness, unsigned char *pflag) { afr_private_t *priv = NULL; int i = 0; @@ -1541,7 +1541,7 @@ afr_selfheal_find_direction(call_frame_t *frame, xlator_t *this, for (i = 0; i < priv->child_count; i++) { for (j = 0; j < priv->child_count; j++) if (matrix[i][j]) - *pflag = _gf_true; + *pflag |= PFLAG_PENDING; if (*pflag) break; } @@ -1623,6 +1623,8 @@ afr_selfheal_find_direction(call_frame_t *frame, xlator_t *this, if (locked_on[i]) sinks[i] = 1; } + if (pflag) + *pflag |= PFLAG_SBRAIN; } /* One more class of witness similar to dirty in v2 is where no pending |