diff options
author | Ravishankar N <ravishankar@redhat.com> | 2017-02-27 13:51:09 +0530 |
---|---|---|
committer | Shyamsundar Ranganathan <srangana@redhat.com> | 2017-03-07 08:54:18 -0500 |
commit | 0c05761bcffaddaadfdd9f954609a9323ce87b24 (patch) | |
tree | 1add1d596f610de9467e08e1e4cd81a05de387b1 /xlators/mgmt | |
parent | fab2c6d574742e6c356d6b364d720540fc354fe8 (diff) |
glusterd: disallow increasing replica count for arbiter volumes
Problem: add-brick command to increase replica count in an arbiter
volume succeeds, causing undesirable effects like the 4th brick being
loaded with the arbiter xlator, the 3rd one losing the arbiter xlator
(when the brick process is restarted), arbitration logic in afr going
for a toss etc.
Fix: Arbiter configuration should always be a replica 3 volume (of
which 3rd brick is arbiter). Hence disallow increasing replica count for
arbiter volume configurations.
> Reviewed-on: https://review.gluster.org/16845
> 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: Atin Mukherjee <amukherj@redhat.com>
(cherry picked from commit b7ba77ab3ffb641d06223f7af5145d3d670b032a)
Change-Id: I9fe4edac880d0f711e6d44324ad5562974e53e51
BUG: 1429773
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-on: https://review.gluster.org/16863
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-brick-ops.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c index 3e358e95795..43465dbf4d8 100644 --- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c @@ -1722,6 +1722,16 @@ glusterd_op_stage_add_brick (dict_t *dict, char **op_errstr, dict_t *rsp_dict) *op_errstr = gf_strdup (msg); goto out; } + /* Do not allow increasing replica count for arbiter volumes. */ + if (replica_count && volinfo->arbiter_count) { + ret = -1; + snprintf (msg, sizeof (msg), "Increasing replica count " + "for arbiter volumes is not supported."); + gf_msg (THIS->name, GF_LOG_ERROR, 0, + GD_MSG_BRICK_ADD_FAIL, "%s", msg); + *op_errstr = gf_strdup (msg); + goto out; + } } is_force = dict_get_str_boolean (dict, "force", _gf_false); |