glusterfs/0328-glusterd-Add-warning-and-abort-in-case-of-failures-i.patch
Rinku Kothiya 6e04ab4906 autobuild v6.0-23
Resolves: bz#1344758 bz#1599802 bz#1685406 bz#1686800 bz#1724021
Resolves: bz#1726058 bz#1727755 bz#1731513 bz#1741193 bz#1758923
Resolves: bz#1761326 bz#1761486 bz#1762180 bz#1764095 bz#1766640
Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
2019-11-21 01:11:39 -05:00

56 lines
2.3 KiB
Diff

From a8d8fc91af226fbf49e9dd1d7d91ad287707c4fe Mon Sep 17 00:00:00 2001
From: Vishal Pandey <vpandey@redhat.com>
Date: Wed, 7 Aug 2019 12:53:06 +0530
Subject: [PATCH 328/335] glusterd: Add warning and abort in case of failures
in migration during remove-brick commit
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.
> Upstream Path Link: https://review.gluster.org/#/c/glusterfs/+/23171/
> Fixes: bz#1514683
> Signed-offby- Vishal Pandey <vpandey@redhat.com>
> Change-Id: I014d0f0afb4b2fac35ab0de52227f98dbae079d5
BUG: 1344758
Change-Id: I014d0f0afb4b2fac35ab0de52227f98dbae079d5
Signed-off-by: Vishal Pandey <vpandey@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/185831
Tested-by: RHGS Build Bot <nigelb@redhat.com>
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
---
xlators/mgmt/glusterd/src/glusterd-brick-ops.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
index ad9a572..c5141de 100644
--- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
@@ -2191,6 +2191,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)
--
1.8.3.1