diff options
author | Atin Mukherjee <amukherj@redhat.com> | 2017-09-07 19:14:23 +0530 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2017-09-19 02:54:10 +0000 |
commit | 7f70d38b66ce755f848ff0197814457a28b321df (patch) | |
tree | 1405b386f301715953a18c7050e1a29487c9f115 /xlators | |
parent | f6775423d7fbe71fe35e6154388e77aae2e264ad (diff) |
glusterd: disallow replace brick for dist only volumes
Allowing replace-brick on dist only volumes will lead to data loss. This
patch blocks replace brick commit force to fail if a volume is dist
only.
Also removing tests/basic/pump.t as its of no use as per the discussion
in
http://lists.gluster.org/pipermail/gluster-devel/2017-September/053652.html
Change-Id: Iabb0c16f865f3fc361b64a19bfcf0c0fbb5c2682
BUG: 1489432
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-on: https://review.gluster.org/18226
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: N Balachandran <nbalacha@redhat.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-replace-brick.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c index ab38725ffb0..08a6df0235f 100644 --- a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c +++ b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c @@ -211,9 +211,19 @@ glusterd_op_stage_replace_brick (dict_t *dict, char **op_errstr, if (ret) goto out; + if (volinfo->type == GF_CLUSTER_TYPE_NONE) { + gf_msg (this->name, GF_LOG_ERROR, 0, GD_MSG_OP_NOT_PERMITTED, + "replace-brick is not permitted on distribute only " + "volumes"); + gf_asprintf (op_errstr, "replace-brick is not permitted on " + "distribute only volumes. Please use add-brick " + "and remove-brick operations instead."); + ret = -1; + goto out; + } ret = glusterd_validate_quorum (this, gd_op, dict, op_errstr); if (ret) { - gf_msg (this->name, GF_LOG_CRITICAL, 0, + gf_msg (this->name, GF_LOG_ERROR, 0, GD_MSG_SERVER_QUORUM_NOT_MET, "Server quorum not met. Rejecting operation."); goto out; |