summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVishal Pandey <vpandey@redhat.com>2019-08-07 12:53:06 +0530
committerAtin Mukherjee <amukherj@redhat.com>2019-08-25 05:19:11 +0000
commit093c66a0af496301e5d28d55f4fe57362cb399d5 (patch)
tree03ef095f05dc55fe97b7bf691d5244c478c256ba
parent30e83561b8dcced2593deb904688177fcd4ff0e0 (diff)
glusterd: Add warning and abort in case of failures in migration during remove-brick commitheal-info
Problem - Currently remove-brick commit goes through even though there were files that failed to migrate or were skipped. There is no warning raised to the user. Solution- Add a check in the remove brick staging phase to verify if the status of the rebalnce process is complete but there has been failures or some skipped files while migration, In this case user will be given a warning and remove-brick commit. User will need to use the force option to remove the bricks. Fixes: bz#1514683 Signed-offby- Vishal Pandey <vpandey@redhat.com> Change-Id: I014d0f0afb4b2fac35ab0de52227f98dbae079d5
-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 870e30d8f22..5e5421ed2dc 100644
--- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
@@ -1883,6 +1883,17 @@ glusterd_op_stage_remove_brick(dict_t *dict, char **op_errstr)
goto out;
}
+ if (volinfo->rebal.defrag_status == GF_DEFRAG_STATUS_COMPLETE) {
+ if (volinfo->rebal.rebalance_failures > 0 ||
+ volinfo->rebal.skipped_files > 0) {
+ errstr = gf_strdup(
+ "use 'force' option as migration "
+ "of some files might have been skipped or "
+ "has failed");
+ goto out;
+ }
+ }
+
ret = glusterd_remove_brick_validate_bricks(
cmd, brick_count, dict, volinfo, &errstr, GF_DEFRAG_CMD_NONE);
if (ret)