summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorhari gowtham <hgowtham@redhat.com>2016-09-09 12:26:52 +0530
committerDan Lambright <dlambrig@redhat.com>2016-09-15 13:49:38 -0700
commit0d56f37f66a65915437746d18897200f4bff39b5 (patch)
tree8b6f5480b30c08a734998843c93cebd989a146c1 /xlators
parentaea936562540d15a6c4708ec9ef050136de483b3 (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> Signed-off-by: hari gowtham <hgowtham@redhat.com> Change-Id: I4f8c3859121ee0827df57348069a243a2502889a BUG: 1375570 Reviewed-on: http://review.gluster.org/15493 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> Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Diffstat (limited to 'xlators')
-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 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);