From d4889b2cfd29e6ecc911d2b29d1f85d516a66eaf Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Wed, 15 Apr 2015 22:53:21 +0530 Subject: arbiter: load arbiter xlator on every 3rd brick of a replica 3 AFR subvol Logic for adding the 'glusterd_brickinfo->group' member and using it to find the brick positon has been taken from http://review.gluster.org/#/c/9919. Thanks to Jeff Darcy for that. 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: Idbfe4f29ee8e098e0102def8f38b32314316b188 BUG: 1199985 Signed-off-by: Ravishankar N Reviewed-on: http://review.gluster.org/10257 Tested-by: NetBSD Build System Reviewed-by: Atin Mukherjee Reviewed-by: Pranith Kumar Karampuri Reviewed-by: Krishnan Parthasarathi Tested-by: Krishnan Parthasarathi --- xlators/cluster/afr/src/afr.c | 6 ++++++ xlators/cluster/afr/src/afr.h | 2 ++ 2 files changed, 8 insertions(+) (limited to 'xlators/cluster/afr/src') diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c index f962fb6494e..21575fed2de 100644 --- a/xlators/cluster/afr/src/afr.c +++ b/xlators/cluster/afr/src/afr.c @@ -274,6 +274,8 @@ init (xlator_t *this) priv->read_child = -1; + GF_OPTION_INIT ("arbiter-count", priv->arbiter_count, uint32, out); + GF_OPTION_INIT ("afr-dirty-xattr", priv->afr_dirty, str, out); GF_OPTION_INIT ("metadata-splitbrain-forced-heal", @@ -794,5 +796,9 @@ struct volume_options options[] = { "attributes from the same subvol as long as it holds " " a good copy of the file/dir.", }, + { .key = {"arbiter-count"}, + .type = GF_OPTION_TYPE_INT, + .description = "subset of child_count. Has to be 0 or 1." + }, { .key = {NULL} }, }; diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h index de000e765ea..f7bc6ea0f94 100644 --- a/xlators/cluster/afr/src/afr.h +++ b/xlators/cluster/afr/src/afr.h @@ -55,6 +55,8 @@ typedef int (*afr_changelog_resume_t) (call_frame_t *frame, xlator_t *this); typedef struct _afr_private { gf_lock_t lock; /* to guard access to child_count, etc */ unsigned int child_count; /* total number of children */ + unsigned int arbiter_count; /*subset of child_count. + Has to be 0 or 1.*/ xlator_t **children; -- cgit