diff options
author | Anuradha <atalur@redhat.com> | 2015-01-23 10:51:11 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2015-01-30 08:28:16 -0800 |
commit | 64132200590a9310ea221524e13db8a09bd89313 (patch) | |
tree | b5618b1583807ac2e3871eaf81662101686a6727 /xlators/cluster/afr/src | |
parent | 0f84f8e8048367737a2dd6ddf0c57403e757441d (diff) |
afr : Change in heal info split-brain command
Implementation of heal info split-brain command with
glfs-heal.
Change-Id: I233eb790de6eb5468a4cbb12a1cef0f97db2a1d2
BUG: 1183019
Signed-off-by: Anuradha <atalur@redhat.com>
Reviewed-on: http://review.gluster.org/9459
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src')
-rw-r--r-- | xlators/cluster/afr/src/afr-common.c | 13 | ||||
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-metadata.c | 4 |
2 files changed, 12 insertions, 5 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c index e6d45add4e8..533a7b5d5a1 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -4452,7 +4452,11 @@ afr_get_heal_info (call_frame_t *frame, xlator_t *this, loc_t *loc, dict = afr_set_heal_info ("split-brain"); } else if (ret == -EAGAIN) { dict = afr_set_heal_info ("possibly-healing"); - } else if (ret == 0) { + } else if (ret >= 0) { + /* value of ret = source index + * so ret >= 0 and at least one of the 3 booleans set to + * true means a source is identified; heal is required. + */ if (!data_selfheal && !entry_selfheal && !metadata_selfheal) { dict = afr_set_heal_info ("no-heal"); @@ -4460,6 +4464,13 @@ afr_get_heal_info (call_frame_t *frame, xlator_t *this, loc_t *loc, dict = afr_set_heal_info ("heal"); } } else if (ret < 0) { + /* Apart from above checked -ve ret values, there are + * other possible ret values like ENOTCONN + * (returned when number of valid replies received are + * less than 2) + * in which case heal is required when one of the + * selfheal booleans is set. + */ if (data_selfheal || entry_selfheal || metadata_selfheal) { dict = afr_set_heal_info ("heal"); diff --git a/xlators/cluster/afr/src/afr-self-heal-metadata.c b/xlators/cluster/afr/src/afr-self-heal-metadata.c index 05d9f2b4917..cd8bb688a11 100644 --- a/xlators/cluster/afr/src/afr-self-heal-metadata.c +++ b/xlators/cluster/afr/src/afr-self-heal-metadata.c @@ -210,12 +210,8 @@ __afr_selfheal_metadata_finalize_source (call_frame_t *frame, xlator_t *this, struct iatt first = {0, }; int source = -1; int sources_count = 0; - dict_t *xdata_req = NULL; - afr_local_t *local = NULL; priv = this->private; - local = frame->local; - xdata_req = local->xdata_req; sources_count = AFR_COUNT (sources, priv->child_count); |