summaryrefslogtreecommitdiffstats
path: root/xlators
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:31:33 -0700
commit7aa64051b275f71693d685b861e5e66eb09b1086 (patch)
tree9151fdc6c984ea4e5de550a5d2cafab674500c6d /xlators
parentfee46d447321689ba059d548f62d7c3c06c24e08 (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: 1333237 Signed-off-by: Sakshi Bansal <sabansal@localhost.localdomain> Reviewed-on: http://review.gluster.org/14172 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>
Diffstat (limited to 'xlators')
-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 e30f27a242a..48af980c3e5 100644
--- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
@@ -2144,6 +2144,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);