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-05 06:30:31 -0700
commita6614f7fa917b2f3e518338c560edb4115b99b30 (patch)
tree9dd1998e7cd1417c744b25ce5772ab1a8459a00c /xlators/mgmt
parent8e84d209b747c3ad067a263b1faea25aba981c20 (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. Backport of http://review.gluster.org/#/c/12513/ > 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> Change-Id: I1eac0ef775cc6910ece0e46ebb04051444d54393 BUG: 1332370 Signed-off-by: Sakshi Bansal <sabansal@localhost.localdomain> Reviewed-on: http://review.gluster.org/14190 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Niels de Vos <ndevos@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.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);