diff options
author | Ravishankar N <ravishankar@redhat.com> | 2015-06-19 14:56:17 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2015-06-22 03:08:32 -0700 |
commit | c13e7d8cb22fb530f765359829f748b9b94103fc (patch) | |
tree | 70c1fd28245dd91ed7b159c3b51896d788a6704c /xlators/cluster/afr | |
parent | cda237fa33c275bb82f82f6d9bfa288d30a7f4ef (diff) |
afr: complete conservative merge even in case of gfid split-brain
Backport of http://review.gluster.org/#/c/9429/
Problem:
While performing conservative merge, we bail out of the merge if we
encounter a file with mismatching gfid or type. What this means is all entries
that come after the mismatching file (during the merge) never get healed, no
matter how many index heals are done.
Fix:
Continue with the merging of rest of the entries even if a gfid/type mismatch
is found, but ensure that post-op does not happen on the parent dir in such a
case.
Change-Id: I725e3ebbb8f8d692179432752c6a6554a924c597
BUG: 1233611
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-on: http://review.gluster.org/11327
Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-by: Anuradha Talur <atalur@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators/cluster/afr')
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-entry.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-entry.c b/xlators/cluster/afr/src/afr-self-heal-entry.c index ab210b37bef..e64b6e45069 100644 --- a/xlators/cluster/afr/src/afr-self-heal-entry.c +++ b/xlators/cluster/afr/src/afr-self-heal-entry.c @@ -508,6 +508,7 @@ afr_selfheal_entry_do_subvol (call_frame_t *frame, xlator_t *this, call_frame_t *iter_frame = NULL; xlator_t *subvol = NULL; afr_private_t *priv = NULL; + gf_boolean_t mismatch = _gf_false; priv = this->private; subvol = priv->children[child]; @@ -537,6 +538,11 @@ afr_selfheal_entry_do_subvol (call_frame_t *frame, xlator_t *this, entry->d_name); AFR_STACK_RESET (iter_frame); + if (ret == -1) { + /* gfid or type mismatch. */ + mismatch = _gf_true; + ret = 0; + } if (ret) break; } @@ -547,6 +553,9 @@ afr_selfheal_entry_do_subvol (call_frame_t *frame, xlator_t *this, } AFR_STACK_DESTROY (iter_frame); + if (mismatch == _gf_true) + /* undo pending will be skipped */ + ret = -1; return ret; } @@ -557,6 +566,7 @@ afr_selfheal_entry_do (call_frame_t *frame, xlator_t *this, fd_t *fd, { int i = 0; afr_private_t *priv = NULL; + gf_boolean_t mismatch = _gf_false; int ret = 0; priv = this->private; @@ -568,14 +578,20 @@ afr_selfheal_entry_do (call_frame_t *frame, xlator_t *this, fd_t *fd, if (i != source && !healed_sinks[i]) continue; ret = afr_selfheal_entry_do_subvol (frame, this, fd, i); + if (ret == -1) { + /* gfid or type mismatch. */ + mismatch = _gf_true; + continue; + } if (ret) break; } + if (mismatch == _gf_true) + /* undo pending will be skipped */ + ret = -1; return ret; } - - static int __afr_selfheal_entry (call_frame_t *frame, xlator_t *this, fd_t *fd, unsigned char *locked_on) |