summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-self-heal-common.c
diff options
context:
space:
mode:
authorAnuradha <atalur@redhat.com>2015-02-25 15:09:28 +0530
committerVijay Bellur <vbellur@redhat.com>2015-03-19 06:33:12 -0700
commitd06692d1deec425f74747e2c463e56f7eca981c8 (patch)
tree2bb530f08506ee80b5704b09a02fb7f1bb75dfea /xlators/cluster/afr/src/afr-self-heal-common.c
parent6f71bc02df5bd177c2f5dbf4e54b2af1525ab979 (diff)
cluster/afr : enable inspection & resolution of files in split-brain
Part 2/2 patch to enable users analyze and resolve split-brain. This patch enables : 1) Users to inspect the files in data and metadata split-brain. 2) Resolve the split-brain. Both using a series of setfattr commands. Consider a volume "test" with 2 bricks. 1) To inspect a file f1: setfattr -n replica.split-brain-choice -v test-client-0 f1 After the execution of this command, if no read_subvol is found, reads will be served from test-client-0 (corresponding to brick-0). 2) To resolve split-brain : setfattr -n replica.split-brain-heal-finalize -v test-client-0 f1 Execution of this command will lead to the resolution of data and metadata split-brain with subvol mentioned in the command (test-client-0 here) as the source and the rest as sink. Change-Id: Ia20f3ee5abd3119e3d54fcc599f1e55ac65fd179 BUG: 1191396 Signed-off-by: Anuradha <atalur@redhat.com> Reviewed-on: http://review.gluster.org/9743 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal-common.c')
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-common.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c
index 2441f413f3e..21b4c4414d9 100644
--- a/xlators/cluster/afr/src/afr-self-heal-common.c
+++ b/xlators/cluster/afr/src/afr-self-heal-common.c
@@ -389,9 +389,11 @@ afr_mark_split_brain_source_sinks (call_frame_t *frame, xlator_t *this,
local = frame->local;
priv = this->private;
xdata_req = local->xdata_req;
+
ret = dict_get_int32 (xdata_req, "heal-op", &heal_op);
if (ret)
goto out;
+
for (i = 0; i < priv->child_count; i++) {
if (locked_on[i])
if (sources[i] || !sinks[i] || !healed_sinks[i]) {
@@ -468,22 +470,6 @@ out:
}
-int
-afr_get_child_index_from_name (xlator_t *this, char *name)
-{
- afr_private_t *priv = this->private;
- int index = -1;
-
- for (index = 0; index < priv->child_count; index++) {
- if (!strcmp (priv->children[index]->name, name))
- goto out;
- }
- index = -1;
-out:
- return index;
-}
-
-
gf_boolean_t
afr_does_witness_exist (xlator_t *this, uint64_t *witness)
{