diff options
author | Anuradha Talur <atalur@redhat.com> | 2016-03-22 14:03:38 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2016-03-23 04:49:36 -0700 |
commit | cf91abba2e6bf22794b04d143f226906e44bf5d5 (patch) | |
tree | 51e769956e57cf0e79cbfa82c586cb0274a0bceb /xlators/cluster/afr/src/afr-common.c | |
parent | ed4feadc8c60fce1d8d99e0732351b92230d6321 (diff) |
afr : Enable auto heal when replica count increases
Backport of: http://review.gluster.org/12454
This patch is part two change to prevent data loss
in a replicate volume on doing a add-brick operation.
Problem: After doing add-brick, there is a chance that
self heal might happen from the newly added brick rather
than the source brick, leading to data loss.
Solution: Mark pending changelogs on afr children for
the new afr-child so that heal is performed in the
correct direction.
>Change-Id: I11871e55eef3593aec874f92214a2d97da229b17
>BUG: 1276203
>Signed-off-by: Anuradha Talur <atalur@redhat.com>
>Reviewed-on: http://review.gluster.org/12454
>Smoke: Gluster Build System <jenkins@build.gluster.com>
>Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
>Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
>CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
>NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Change-Id: Iae6af44f97e612cb3ee8c642254ec3d15ac063f5
BUG: 1320020
Signed-off-by: Anuradha Talur <atalur@redhat.com>
Reviewed-on: http://review.gluster.org/13807
Smoke: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-common.c')
-rw-r--r-- | xlators/cluster/afr/src/afr-common.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c index b5d07acf338..6b393c77a96 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -5113,3 +5113,14 @@ afr_get_need_heal (xlator_t *this) UNLOCK (&priv->lock); return need_heal; } + +int +afr_get_msg_id (char *op_type) +{ + + if (!strcmp (op_type, GF_AFR_REPLACE_BRICK)) + return AFR_MSG_REPLACE_BRICK_STATUS; + else if (!strcmp (op_type, GF_AFR_ADD_BRICK)) + return AFR_MSG_ADD_BRICK_STATUS; + return -1; +} |