From 7f70d38b66ce755f848ff0197814457a28b321df Mon Sep 17 00:00:00 2001 From: Atin Mukherjee Date: Thu, 7 Sep 2017 19:14:23 +0530 Subject: 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 Reviewed-on: https://review.gluster.org/18226 Smoke: Gluster Build System Reviewed-by: N Balachandran CentOS-regression: Gluster Build System --- xlators/mgmt/glusterd/src/glusterd-replace-brick.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'xlators') 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; -- cgit