From 6000e1aa344e523aa161427a0b9781e052cd4d97 Mon Sep 17 00:00:00 2001 From: Dan Lambright Date: Thu, 1 Oct 2015 11:05:25 -0400 Subject: cluster/tier: Disallow detach commit when detach in progress 1. Check if detach is running, disallow detach commit if so. 2. Cleanup shutdown of tier daemon on detach: do not rerun fix-layout, do not send incorrect status back to glusterd. Change-Id: I97202f748773c1176396a4ffd32a4c7fa9b9c1bc BUG: 1279637 Signed-off-by: Dan Lambright Reviewed-on: http://review.gluster.org/12560 Tested-by: Gluster Build System Reviewed-by: Atin Mukherjee --- xlators/mgmt/glusterd/src/glusterd-brick-ops.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'xlators/mgmt/glusterd/src') diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c index efd70581f46..67119a9b53b 100644 --- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c @@ -2046,6 +2046,31 @@ glusterd_op_stage_remove_brick (dict_t *dict, char **op_errstr) GD_MSG_VOL_NOT_TIER, "%s", errstr); goto out; } + ret = glusterd_remove_brick_validate_bricks (cmd, brick_count, + dict, volinfo, + &errstr); + if (ret) + goto out; + + /* If geo-rep is configured, for this volume, it should be + * stopped. + */ + param.volinfo = volinfo; + ret = glusterd_check_geo_rep_running (¶m, op_errstr); + if (ret || param.is_active) { + ret = -1; + goto out; + } + + if (volinfo->rebal.defrag_status == GF_DEFRAG_STATUS_STARTED) { + ret = -1; + errstr = gf_strdup("Detach is in progress. Please " + "retry after completion"); + gf_msg (this->name, GF_LOG_ERROR, 0, + GD_MSG_OIP_RETRY_LATER, "%s", errstr); + goto out; + } + break; case GF_OP_CMD_COMMIT: if (volinfo->decommission_in_progress) { -- cgit