From 25e8e74eb7b81ccd114a9833371a3f72d284c48d Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Wed, 15 Apr 2015 22:22:08 +0530 Subject: afr: add arbitration support Add logic in afr to work in conjunction with the arbiter xlator when a replica 3 arbiter volume is created. More specifically, this patch: * Enables full locks for afr data transaction for such volumes. * Removes the upfront marking of pending xattrs at the time of pre-op and defer it to post-op. (This is an arbiter independent change and is made for all afr transactions.) * After pre-op stage, check if we can proceed with the fop stage without ending up in split-brain by examining the changelog xattrs. * Unwinds the fop with failure if only one source was available at the time of pre-op and the fop happened to fail on particular source brick. * Skips data self-heal if arbiter brick is the only source available. * Adds the arbiter-count option to the shd graph. This patch is a part of the arbiter logic implementation for 3 way AFR details of which can be found at http://review.gluster.org/#/c/9656/ Change-Id: I9603db9d04de5626eb2f4d8d959ef5b46113561d BUG: 1199985 Signed-off-by: Ravishankar N Reviewed-on: http://review.gluster.org/10258 Tested-by: Gluster Build System Reviewed-by: Pranith Kumar Karampuri --- xlators/mgmt/glusterd/src/glusterd-volgen.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'xlators/mgmt/glusterd') diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c index fe281dd33db..a56d6d5ccca 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volgen.c +++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c @@ -4059,19 +4059,6 @@ out: return ret; } -static int -volgen_graph_build_replicate_clusters (volgen_graph_t *graph, - glusterd_volinfo_t *volinfo) -{ - char *replicate_args[] = {"cluster/replicate", - "%s-replicate-%d"}; - - return volgen_link_bricks_from_list_tail (graph, volinfo, "cluster/replicate", - "%s-replicate-%d", - volinfo->brick_count, - volinfo->replica_count); -} - static int build_shd_clusters (volgen_graph_t *graph, glusterd_volinfo_t *volinfo, dict_t *set_dict) @@ -4086,8 +4073,7 @@ build_shd_clusters (volgen_graph_t *graph, glusterd_volinfo_t *volinfo, switch (volinfo->type) { case GF_CLUSTER_TYPE_REPLICATE: case GF_CLUSTER_TYPE_STRIPE_REPLICATE: - clusters = volgen_graph_build_replicate_clusters (graph, - volinfo); + clusters = volgen_graph_build_afr_clusters (graph, volinfo); break; case GF_CLUSTER_TYPE_DISPERSE: -- cgit