summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-self-heal.h
diff options
context:
space:
mode:
authorRavishankar N <ravishankar@redhat.com>2017-01-30 09:54:16 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2017-02-09 20:37:00 -0500
commit0e03336a9362e5717e561f76b0c543e5a197b31b (patch)
tree28be72abb87f19d28b82c9ac7cec61533a968d05 /xlators/cluster/afr/src/afr-self-heal.h
parent55625293093d485623f3f3d98687cd1e2c594460 (diff)
afr: all children of AFR must be up to resolve s-brain
Problem: The various split-brain resolution policies (favorite-child-policy based, CLI based and mount (get/setfattr) based) attempt to resolve split-brain even when not all bricks of replica are up. This can be a problem when say in a replica 3, the only good copy is down and the other 2 bricks are up and blame each other (i.e. split-brain). We end up healing the file in such a case and allow I/O on it. Fix: A decision on whether the file is in split-brain or not must be taken only if we are able to examine the afr xattrs of *all* bricks of a given replica. Change-Id: Icddb1268b380005799990f5379ef957d84639ef9 BUG: 1417522 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: https://review.gluster.org/16476 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal.h')
-rw-r--r--xlators/cluster/afr/src/afr-self-heal.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal.h b/xlators/cluster/afr/src/afr-self-heal.h
index 500227abe24..a33905033cc 100644
--- a/xlators/cluster/afr/src/afr-self-heal.h
+++ b/xlators/cluster/afr/src/afr-self-heal.h
@@ -81,7 +81,8 @@
#define IA_EQUAL(f,s,field) (memcmp (&(f.ia_##field), &(s.ia_##field), sizeof (s.ia_##field)) == 0)
-
+#define SBRAIN_HEAL_NO_GO_MSG "Failed to obtain replies from all bricks of "\
+ "the replica (are they up?). Cannot resolve split-brain."
int
afr_selfheal (xlator_t *this, uuid_t gfid);
@@ -220,6 +221,9 @@ afr_mark_active_sinks (xlator_t *this, unsigned char *sources,
gf_boolean_t
afr_dict_contains_heal_op (call_frame_t *frame);
+gf_boolean_t
+afr_can_decide_split_brain_source_sinks (struct afr_reply *replies,
+ int child_count);
int
afr_mark_split_brain_source_sinks (call_frame_t *frame, xlator_t *this,
inode_t *inode,