diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2015-02-02 18:49:01 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2015-03-05 21:56:20 -0800 |
commit | 3797caabb95ad8e62dee74a5331d324ddffc654f (patch) | |
tree | ffc7c647e40388e9229b80a5aff710538c710f73 /xlators/cluster/afr/src/afr.c | |
parent | 8fa36bc7a11968086e31ac32b9a24de07dd50d15 (diff) |
cluster/afr: Implementation of quorum-reads
Provide a way of disabling reads when quorum is not met.
Change-Id: Ic4f57c2b87a0b8514600759de3a7a47e217fe3b5
BUG: 1187885
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/9543
Reviewed-by: Ravishankar N <ravishankar@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr.c')
-rw-r--r-- | xlators/cluster/afr/src/afr.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c index bf7ba3fb0ac..f435767f5e4 100644 --- a/xlators/cluster/afr/src/afr.c +++ b/xlators/cluster/afr/src/afr.c @@ -211,6 +211,9 @@ reconfigure (xlator_t *this, dict_t *options) GF_OPTION_RECONF ("heal-timeout", priv->shd.timeout, options, int32, out); + GF_OPTION_RECONF ("quorum-reads", priv->quorum_reads, options, + bool, out); + priv->did_discovery = _gf_false; ret = 0; @@ -359,6 +362,8 @@ init (xlator_t *this) GF_OPTION_INIT ("iam-self-heal-daemon", priv->shd.iamshd, bool, out); GF_OPTION_INIT ("heal-timeout", priv->shd.timeout, int32, out); + GF_OPTION_INIT ("quorum-reads", priv->quorum_reads, bool, out); + priv->wait_count = 1; priv->child_up = GF_CALLOC (sizeof (unsigned char), child_count, @@ -724,6 +729,12 @@ struct volume_options options[] = { "this many bricks or present. Other quorum types " "will OVERWRITE this value.", }, + { .key = {"quorum-reads"}, + .type = GF_OPTION_TYPE_BOOL, + .default_value = "no", + .description = "If quorum-reads is \"true\" only allow reads if " + "quorum is met when quorum is enabled.", + }, { .key = {"node-uuid"}, .type = GF_OPTION_TYPE_STR, .description = "Local glusterd uuid string, used in starting " |