From 1afa0bd91fd23b5131ccc1cceb814a061ac99096 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 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 --- xlators/mgmt/glusterd/src/glusterd-brick-ops.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'xlators/mgmt/glusterd/src/glusterd-brick-ops.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c index 8458876f50f..276c6df0aee 100644 --- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c @@ -2227,6 +2227,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