summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhari gowtham <hgowtham@redhat.com>2016-09-09 12:26:52 +0530
committerDan Lambright <dlambrig@redhat.com>2016-09-16 05:56:53 -0700
commit7f4a693ee55d9c517f6b583e551518a6d643e6ff (patch)
tree58fa638ff76b3c158a49d2b80734826953f3832a
parent65679d285e99eb4dafe54c97fcc65146dadbde61 (diff)
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 <hgowtham@redhat.com> > Reviewed-on: http://review.gluster.org/15438 > Smoke: Gluster Build System <jenkins@build.gluster.org> > Tested-by: hari gowtham <hari.gowtham005@gmail.com> > NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> > CentOS-regression: Gluster Build System <jenkins@build.gluster.org> > Reviewed-by: Dan Lambright <dlambrig@redhat.com> > Tested-by: Dan Lambright <dlambrig@redhat.com> Change-Id: I4098c45f5338f8bc4262e75fa6630dabc755e133 BUG: 1375565 Signed-off-by: hari gowtham <hgowtham@redhat.com> Reviewed-on: http://review.gluster.org/15492 Tested-by: hari gowtham <hari.gowtham005@gmail.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Dan Lambright <dlambrig@redhat.com>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-brick-ops.c11
1 files changed, 11 insertions, 0 deletions
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);