summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt
diff options
context:
space:
mode:
authorSakshi Bansal <sabansal@redhat.com>2015-11-05 15:09:31 +0530
committerAtin Mukherjee <amukherj@redhat.com>2016-05-02 20:53:00 -0700
commit614a048c59d9b22e090acc0f1bdcb8c1be67f97a (patch)
tree515d8a5aa262a93b69e6a2a1816615d1bb631ff6 /xlators/mgmt
parent7f92a3de16f9ac34a9c215a7bc067dc6d084af14 (diff)
glusterd: remove-brick commit should not succeed when migration failed
While remove a brick if the data migration was not successful, remove-brick commit should not succeed as this can lead to data loss. Change-Id: I1eac0ef775cc6910ece0e46ebb04051444d54393 BUG: 1278325 Signed-off-by: Sakshi Bansal <sabansal@localhost.localdomain> Reviewed-on: http://review.gluster.org/12513 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Tested-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-brick-ops.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
index b6d9703591c..35c834a11ce 100644
--- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
@@ -2140,6 +2140,12 @@ glusterd_op_stage_remove_brick (dict_t *dict, char **op_errstr)
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);