summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2017-09-07 19:14:23 +0530
committerjiffin tony Thottan <jthottan@redhat.com>2017-10-12 05:38:57 +0000
commit08e083ac43f3b35892df808f41d4f9fbe6c2154b (patch)
tree4f7c0cededdfefd1f0833d2439c5b25eed4f3d23 /xlators
parentc49fcf570439e47a5e1224436bbaf3f8dd580105 (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 >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> >(cherry picked from commit 7f70d38b66ce755f848ff0197814457a28b321df) Change-Id: Iabb0c16f865f3fc361b64a19bfcf0c0fbb5c2682 BUG: 1493975 Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-replace-brick.c12
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;