|
|
21ab4e |
From a69829577102c905a37c413e2140ed05e1b55122 Mon Sep 17 00:00:00 2001
|
|
|
21ab4e |
From: Susant Palai <spalai@redhat.com>
|
|
|
21ab4e |
Date: Thu, 27 Jul 2017 16:33:12 +0530
|
|
|
21ab4e |
Subject: [PATCH 582/587] cluster/dht: Handle wrong rebalance status reporting
|
|
|
21ab4e |
|
|
|
21ab4e |
> Change-Id: Id91ef35f890055cd42b9a94462f92297c77f1fff
|
|
|
21ab4e |
> Bug: 1475282
|
|
|
21ab4e |
> Signed-off-by: Susant Palai <spalai@redhat.com>
|
|
|
21ab4e |
> Reviewed-on: https://review.gluster.org/17868
|
|
|
21ab4e |
> Tested-by: Raghavendra G <rgowdapp@redhat.com>
|
|
|
21ab4e |
> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
|
|
|
21ab4e |
> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
|
|
|
21ab4e |
> Smoke: Gluster Build System <jenkins@build.gluster.org>
|
|
|
21ab4e |
> Signed-off-by: Susant Palai <spalai@redhat.com>
|
|
|
21ab4e |
|
|
|
21ab4e |
Change-Id: Id91ef35f890055cd42b9a94462f92297c77f1fff
|
|
|
21ab4e |
Bug: 1474812
|
|
|
21ab4e |
Signed-off-by: Susant Palai <spalai@redhat.com>
|
|
|
21ab4e |
Reviewed-on: https://code.engineering.redhat.com/gerrit/114018
|
|
|
21ab4e |
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
|
|
21ab4e |
---
|
|
|
21ab4e |
xlators/cluster/dht/src/dht-rebalance.c | 61 +++++++++++++++++----------------
|
|
|
21ab4e |
1 file changed, 32 insertions(+), 29 deletions(-)
|
|
|
21ab4e |
|
|
|
21ab4e |
diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c
|
|
|
21ab4e |
index 896db79..b446136 100644
|
|
|
21ab4e |
--- a/xlators/cluster/dht/src/dht-rebalance.c
|
|
|
21ab4e |
+++ b/xlators/cluster/dht/src/dht-rebalance.c
|
|
|
21ab4e |
@@ -872,7 +872,7 @@ static int
|
|
|
21ab4e |
__dht_check_free_space (xlator_t *this, xlator_t *to, xlator_t *from, loc_t *loc,
|
|
|
21ab4e |
struct iatt *stbuf, int flag, dht_conf_t *conf,
|
|
|
21ab4e |
gf_boolean_t *target_changed, xlator_t **new_subvol,
|
|
|
21ab4e |
- gf_boolean_t *ignore_failure, int *fop_errno)
|
|
|
21ab4e |
+ int *fop_errno)
|
|
|
21ab4e |
{
|
|
|
21ab4e |
struct statvfs src_statfs = {0,};
|
|
|
21ab4e |
struct statvfs dst_statfs = {0,};
|
|
|
21ab4e |
@@ -882,7 +882,6 @@ __dht_check_free_space (xlator_t *this, xlator_t *to, xlator_t *from, loc_t *loc
|
|
|
21ab4e |
uint64_t src_statfs_blocks = 1;
|
|
|
21ab4e |
uint64_t dst_statfs_blocks = 1;
|
|
|
21ab4e |
double post_availspacepercent = 0;
|
|
|
21ab4e |
- int i = 0;
|
|
|
21ab4e |
|
|
|
21ab4e |
xdata = dict_new ();
|
|
|
21ab4e |
if (!xdata) {
|
|
|
21ab4e |
@@ -1026,21 +1025,7 @@ find_new_subvol:
|
|
|
21ab4e |
" with space accomodating the file - %s. Consider adding "
|
|
|
21ab4e |
"bricks", loc->path);
|
|
|
21ab4e |
|
|
|
21ab4e |
- /* For remove-brick case if the source is not one of the
|
|
|
21ab4e |
- * removed-brick, do not mark the error as failure */
|
|
|
21ab4e |
- if (conf->decommission_subvols_cnt) {
|
|
|
21ab4e |
- *ignore_failure = _gf_true;
|
|
|
21ab4e |
- for (i = 0; i < conf->subvolume_cnt; i++) {
|
|
|
21ab4e |
- if (conf->decommissioned_bricks[i] == from) {
|
|
|
21ab4e |
- *ignore_failure = _gf_false;
|
|
|
21ab4e |
- break;
|
|
|
21ab4e |
- }
|
|
|
21ab4e |
- }
|
|
|
21ab4e |
- } else {
|
|
|
21ab4e |
- *ignore_failure = _gf_false;
|
|
|
21ab4e |
- }
|
|
|
21ab4e |
-
|
|
|
21ab4e |
- *target_changed = _gf_false;
|
|
|
21ab4e |
+ *target_changed = _gf_false;
|
|
|
21ab4e |
*fop_errno = ENOSPC;
|
|
|
21ab4e |
ret = -1;
|
|
|
21ab4e |
goto out;
|
|
|
21ab4e |
@@ -1557,7 +1542,6 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,
|
|
|
21ab4e |
xlator_t *new_target = NULL;
|
|
|
21ab4e |
xlator_t *old_target = NULL;
|
|
|
21ab4e |
fd_t *linkto_fd = NULL;
|
|
|
21ab4e |
- gf_boolean_t ignore_failure = _gf_false;
|
|
|
21ab4e |
|
|
|
21ab4e |
|
|
|
21ab4e |
if (from == to) {
|
|
|
21ab4e |
@@ -1708,7 +1692,7 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,
|
|
|
21ab4e |
clean_dst = _gf_true;
|
|
|
21ab4e |
|
|
|
21ab4e |
ret = __dht_check_free_space (this, to, from, loc, &stbuf, flag, conf,
|
|
|
21ab4e |
- &target_changed, &new_target, &ignore_failure, fop_errno);
|
|
|
21ab4e |
+ &target_changed, &new_target, fop_errno);
|
|
|
21ab4e |
if (target_changed) {
|
|
|
21ab4e |
/* Can't handle for hardlinks. Marking this as failure */
|
|
|
21ab4e |
if (flag == GF_DHT_MIGRATE_HARDLINK_IN_PROGRESS || stbuf.ia_nlink > 1) {
|
|
|
21ab4e |
@@ -1757,9 +1741,6 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,
|
|
|
21ab4e |
}
|
|
|
21ab4e |
|
|
|
21ab4e |
if (ret) {
|
|
|
21ab4e |
- if (ignore_failure)
|
|
|
21ab4e |
- ret = 0;
|
|
|
21ab4e |
-
|
|
|
21ab4e |
goto out;
|
|
|
21ab4e |
}
|
|
|
21ab4e |
|
|
|
21ab4e |
@@ -2595,6 +2576,8 @@ gf_defrag_migrate_single_file (void *opaque)
|
|
|
21ab4e |
gf_dht_migrate_data_type_t rebal_type = GF_DHT_MIGRATE_DATA;
|
|
|
21ab4e |
char value[MAX_REBAL_TYPE_SIZE] = {0,};
|
|
|
21ab4e |
struct iatt *iatt_ptr = NULL;
|
|
|
21ab4e |
+ gf_boolean_t update_skippedcount = _gf_true;
|
|
|
21ab4e |
+ int i = 0;
|
|
|
21ab4e |
|
|
|
21ab4e |
rebal_entry = (struct dht_container *)opaque;
|
|
|
21ab4e |
if (!rebal_entry) {
|
|
|
21ab4e |
@@ -2734,11 +2717,32 @@ gf_defrag_migrate_single_file (void *opaque)
|
|
|
21ab4e |
gf_msg_debug (this->name, 0, "migrate-data skipped for"
|
|
|
21ab4e |
" %s due to space constraints",
|
|
|
21ab4e |
entry_loc.path);
|
|
|
21ab4e |
- LOCK (&defrag->lock);
|
|
|
21ab4e |
- {
|
|
|
21ab4e |
- defrag->skipped += 1;
|
|
|
21ab4e |
+
|
|
|
21ab4e |
+ /* For remove-brick case if the source is not one of the
|
|
|
21ab4e |
+ * removed-brick, do not mark the error as failure */
|
|
|
21ab4e |
+ if (conf->decommission_subvols_cnt) {
|
|
|
21ab4e |
+ for (i = 0; i < conf->subvolume_cnt; i++) {
|
|
|
21ab4e |
+ if (conf->decommissioned_bricks[i] == cached_subvol) {
|
|
|
21ab4e |
+ LOCK (&defrag->lock);
|
|
|
21ab4e |
+ {
|
|
|
21ab4e |
+ defrag->total_failures += 1;
|
|
|
21ab4e |
+ update_skippedcount = _gf_false;
|
|
|
21ab4e |
+ }
|
|
|
21ab4e |
+ UNLOCK (&defrag->lock);
|
|
|
21ab4e |
+
|
|
|
21ab4e |
+ break;
|
|
|
21ab4e |
+ }
|
|
|
21ab4e |
+ }
|
|
|
21ab4e |
}
|
|
|
21ab4e |
- UNLOCK (&defrag->lock);
|
|
|
21ab4e |
+
|
|
|
21ab4e |
+ if (update_skippedcount) {
|
|
|
21ab4e |
+ LOCK (&defrag->lock);
|
|
|
21ab4e |
+ {
|
|
|
21ab4e |
+ defrag->skipped += 1;
|
|
|
21ab4e |
+ }
|
|
|
21ab4e |
+ UNLOCK (&defrag->lock);
|
|
|
21ab4e |
+ }
|
|
|
21ab4e |
+
|
|
|
21ab4e |
} else if (fop_errno == ENOTSUP) {
|
|
|
21ab4e |
gf_msg_debug (this->name, 0, "migrate-data skipped for"
|
|
|
21ab4e |
" hardlink %s ", entry_loc.path);
|
|
|
21ab4e |
@@ -2769,10 +2773,9 @@ gf_defrag_migrate_single_file (void *opaque)
|
|
|
21ab4e |
strerror (fop_errno));
|
|
|
21ab4e |
} else if (ret == 1) {
|
|
|
21ab4e |
ret = 0;
|
|
|
21ab4e |
- goto out;
|
|
|
21ab4e |
- } else if (ret == -1) {
|
|
|
21ab4e |
- goto out;
|
|
|
21ab4e |
}
|
|
|
21ab4e |
+
|
|
|
21ab4e |
+ goto out;
|
|
|
21ab4e |
}
|
|
|
21ab4e |
|
|
|
21ab4e |
LOCK (&defrag->lock);
|
|
|
21ab4e |
--
|
|
|
21ab4e |
1.8.3.1
|
|
|
21ab4e |
|