From 7f4a693ee55d9c517f6b583e551518a6d643e6ff Mon Sep 17 00:00:00 2001 From: hari gowtham Date: Fri, 9 Sep 2016 12:26:52 +0530 Subject: Tier: failing detach commit on detach failure and in-progress back-port of:http://review.gluster.org/#/c/15438/ PROBLEM: if detach status has failed or if it remains in progress we allow detach commit to happen. only detach force should be allowed. FIX: check the detach status for failure or inprogress and disallow with the apt error message. > Change-Id: Ib97d540fec67717bb55c18d133187c665cf69ef1 > BUG: 1374584 > Signed-off-by: hari gowtham > Reviewed-on: http://review.gluster.org/15438 > Smoke: Gluster Build System > Tested-by: hari gowtham > NetBSD-regression: NetBSD Build System > CentOS-regression: Gluster Build System > Reviewed-by: Dan Lambright > Tested-by: Dan Lambright Change-Id: I4098c45f5338f8bc4262e75fa6630dabc755e133 BUG: 1375565 Signed-off-by: hari gowtham Reviewed-on: http://review.gluster.org/15492 Tested-by: hari gowtham CentOS-regression: Gluster Build System Smoke: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Dan Lambright --- xlators/mgmt/glusterd/src/glusterd-brick-ops.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c index a90114ab2b3..706dadef71e 100644 --- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c @@ -2222,6 +2222,17 @@ glusterd_op_stage_remove_brick (dict_t *dict, char **op_errstr) GD_MSG_VOL_NOT_TIER, "%s", errstr); goto out; } + if (volinfo->decommission_in_progress) { + errstr = gf_strdup ("use 'force' option as migration " + "is in progress"); + goto out; + } + if (volinfo->rebal.defrag_status == GF_DEFRAG_STATUS_FAILED) { + errstr = gf_strdup ("use 'force' option as migration " + "has failed"); + goto out; + } + ret = glusterd_remove_brick_validate_bricks (cmd, brick_count, dict, volinfo, &errstr); -- cgit