diff options
author | Ravishankar N <ravishankar@redhat.com> | 2019-09-28 08:53:08 +0530 |
---|---|---|
committer | hari gowtham <hari.gowtham005@gmail.com> | 2019-10-17 10:51:33 +0000 |
commit | 50dbcd45fa3165247608e2b889d6a802ba5d6323 (patch) | |
tree | ecbcfe982909d9ee13a479b7fa8cb14ed5633fd4 /xlators/cluster/afr/src | |
parent | cc853e02ea42ab1b86d94f7ed83574c3e07bcb0c (diff) |
afr: support split-brain CLI for replica 3
Ever since we added quorum checks for lookups in afr via commit
bd44d59741bb8c0f5d7a62c5b1094179dd0ce8a4, the split-brain resolution
commands would not work for replica 3 because there would be no
readables for the lookup fop.
The argument was that split-brains do not occur in replica 3 but we do
see (data/metadata) split-brain cases once in a while which indicate that there are
a few bugs/corner cases yet to be discovered and fixed.
Fortunately, commit 8016d51a3bbd410b0b927ed66be50a09574b7982 added
GF_CLIENT_PID_GLFS_HEALD as the pid for all fops made by glfsheal. If we
leverage this and allow lookups in afr when pid is GF_CLIENT_PID_GLFS_HEALD,
split-brain resolution commands will work for replica 3 volumes too.
Likewise, the check is added in shard_lookup as well to permit resolving
split-brains by specifying "/.shard/shard-file.xx" as the file name
(which previously used to fail with EPERM).
Change-Id: I3c543dea79caf7cfbc1633e9089cb1cdd2538ba9
Fixes: bz#1760792
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
(cherry picked from commit 47dbd753187f69b3835d2e42fdbe7485874c4b3e)
Diffstat (limited to 'xlators/cluster/afr/src')
-rw-r--r-- | xlators/cluster/afr/src/afr-common.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c index 9a6475b6ec8..0e50c9656bc 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -2255,7 +2255,8 @@ afr_attempt_readsubvol_set(call_frame_t *frame, xlator_t *this, if ((spb_choice >= 0) && (AFR_COUNT(success_replies, child_count) == child_count)) { *read_subvol = spb_choice; - } else if (!priv->quorum_count) { + } else if (!priv->quorum_count || + frame->root->pid == GF_CLIENT_PID_GLFS_HEAL) { *read_subvol = afr_first_up_child(frame, this); } else if (priv->quorum_count && afr_has_quorum(data_readable, this, NULL)) { |