diff options
| author | Richard Wareing <rwareing@fb.com> | 2015-11-18 20:02:40 -0800 |
|---|---|---|
| committer | Jeff Darcy <jeff@pl.atyp.us> | 2017-08-15 15:05:59 +0000 |
| commit | 233156d6fc1eabed41fcae6a877db3d66ff6f073 (patch) | |
| tree | fdb3e3dc7587b95047e4ca8a4421f37b2bb49675 /xlators/cluster | |
| parent | 7a6cdff114fdb464fdcd73addcf9ece6383219a5 (diff) | |
cluster/dht: Fix rebalance bug + better logging
Summary:
- Fixes edge case where lookup by gfid fails because it's not copied
into the inode struct from the loc_t struct during the readdir loop
- Improved logging for error conditions
Test Plan:
- Tested on dev server
- Canaried build on <redacted>
Reviewers: dph, moox, sshreyas
Reviewed By: sshreyas
Differential Revision: https://phabricator.fb.com/D2676693
Tasks: 9034954
Change-Id: I7f0160b391c43fc38e679fdb660cee59d2267932
Signed-off-by: Jeff Darcy <jdarcy@fb.com>
Reviewed-on: https://review.gluster.org/18040
Smoke: Gluster Build System <jenkins@build.gluster.org>
Tested-by: Jeff Darcy <jeff@pl.atyp.us>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Jeff Darcy <jeff@pl.atyp.us>
Diffstat (limited to 'xlators/cluster')
| -rw-r--r-- | xlators/cluster/dht/src/dht-rebalance.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c index ffd8bac9e4f..dc0b7dd619e 100644 --- a/xlators/cluster/dht/src/dht-rebalance.c +++ b/xlators/cluster/dht/src/dht-rebalance.c @@ -1328,14 +1328,25 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to, /* create the destination, with required modes/xattr */ ret = __dht_rebalance_create_dst_file (to, from, loc, &stbuf, &dst_fd, xattr); - if (ret) - goto out; + if (ret) { + gf_msg (this->name, GF_LOG_ERROR, 0, + DHT_MSG_MIGRATE_FILE_FAILED, + "Migrate file failed: %s: " + "failed to create dest file on %s", + loc->path, to->name); + goto out; + } clean_dst = _gf_true; ret = __dht_check_free_space (to, from, loc, &stbuf, flag); if (ret) { + gf_msg (this->name, GF_LOG_ERROR, 0, + DHT_MSG_MIGRATE_FILE_FAILED, + "Migrate file failed: %s: " + "Disk space check failed on %s", + loc->path, to->name); goto out; } @@ -1345,7 +1356,7 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to, if (ret) { gf_msg (this->name, GF_LOG_ERROR, 0, DHT_MSG_MIGRATE_FILE_FAILED, - "Migrate file failed: failed to open %s on %s", + "Migrate file failed: %s: failed to open on %s", loc->path, from->name); goto out; } @@ -1360,7 +1371,7 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to, if (ret) { gf_msg (this->name, GF_LOG_ERROR, -ret, DHT_MSG_MIGRATE_FILE_FAILED, - "Migrate file failed:failed to lookup %s on %s ", + "Migrate file failed: %s: failed to lookup %s ", loc->path, from->name); ret = -1; goto out; @@ -2427,6 +2438,9 @@ gf_defrag_get_entry (xlator_t *this, int i, struct dht_container **container, goto out; } + gf_uuid_copy (entry_loc.inode->gfid, + df_entry->d_stat.ia_gfid); + if (gf_uuid_is_null (df_entry->d_stat.ia_gfid)) { gf_msg (this->name, GF_LOG_ERROR, 0, DHT_MSG_GFID_NULL, |
