diff options
author | Anuradha <atalur@redhat.com> | 2015-06-11 14:58:05 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2015-06-27 06:08:54 -0700 |
commit | b319d712e97e1074cc6030220d00970d1262458b (patch) | |
tree | d892218d723cf38ee3a8f55fe474c4842092a57e /xlators/cluster/afr/src/afr-self-heal-entry.c | |
parent | 9ed31ab1a5718e01b22ea9e39c28759759bf023c (diff) |
cluster/afr : set pending xattrs for replaced brick
Backport of: http://review.gluster.org/10448/
& http://review.gluster.org/11416
This patch is part two change to prevent data loss
in a replicate volume on doing a replace-brick commit
force operation.
Problem: After doing replace-brick commit force, there is a
chance that self heal might happen from the replaced (sink) brick
rather than the source brick leading to data loss.
Solution: Mark pending changelogs on afr children for
the replaced afr-child so that heal is performed in the
correct direction.
Credits to Ravishankar N for patch 11416.
Change-Id: Icb9807e49b4c1c4f1dcab115318d9a58ccf95675
BUG: 1232173
Reviewed-on: http://review.gluster.org/10448
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
Signed-off-by: Anuradha Talur <atalur@redhat.com>
Reviewed-on: http://review.gluster.org/11254
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal-entry.c')
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-entry.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-entry.c b/xlators/cluster/afr/src/afr-self-heal-entry.c index e64b6e45069..12da920f5f1 100644 --- a/xlators/cluster/afr/src/afr-self-heal-entry.c +++ b/xlators/cluster/afr/src/afr-self-heal-entry.c @@ -295,6 +295,13 @@ __afr_selfheal_merge_dirent (call_frame_t *frame, xlator_t *this, fd_t *fd, return 0; } + /* Set all the sources as 1, otheriwse newentry_mark won't be set */ + for (i = 0; i < priv->child_count; i++) { + if (replies[i].valid && replies[i].op_ret == 0) { + sources[i] = 1; + } + } + /* In case of a gfid or type mismatch on the entry, return -1.*/ ret = afr_selfheal_detect_gfid_and_type_mismatch (this, replies, fd->inode->gfid, |