diff options
author | Susant Palai <spalai@redhat.com> | 2017-06-21 17:52:45 +0530 |
---|---|---|
committer | Shyamsundar Ranganathan <srangana@redhat.com> | 2017-06-26 16:27:07 +0000 |
commit | f67dbab74a3d0a13a8f7ed31b8cc840c05042913 (patch) | |
tree | 5e859d63d2b5b9b26a182e6ef8c9d08f8126ab19 /xlators/cluster/dht/src/dht-rebalance.c | |
parent | 91c44b41654ae10a2278ee8c494910a46196077a (diff) |
cluster/rebalance: Use GF_XATTR_LIST_NODE_UUIDS_KEY to figure out local subvols.
Afr has introduced a new key GF_XATTR_LIST_NODE_UUIDS_KEY,
through which rebalance will figure out its local subvolumes.(Reference
bugid=1463250)
key: GF_XATTR_NODE_UUID_KEY will continue to serve it's old
purpose of returning the first afr chiild.
test: prove tests/basic/distribute/rebal-all-nodes-migrate.t
> BUG: 1463648
> Signed-off-by: Susant Palai <spalai@redhat.com>
Change-Id: I4d602feda2a05b29d2210c712a07a4ac6b8bc112
BUG: 1463250
Signed-off-by: N Balachandran <nbalacha@redhat.com>
Reviewed-on: https://review.gluster.org/17627
Smoke: Gluster Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht-rebalance.c')
-rw-r--r-- | xlators/cluster/dht/src/dht-rebalance.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c index 4653ae798c1..087d67ad891 100644 --- a/xlators/cluster/dht/src/dht-rebalance.c +++ b/xlators/cluster/dht/src/dht-rebalance.c @@ -4091,21 +4091,40 @@ dht_get_local_subvols_and_nodeuuids (xlator_t *this, dht_conf_t *conf, loc_t *loc) { - dict_t *dict = NULL; - int ret = -1; + dict_t *dict = NULL; + gf_defrag_info_t *defrag = NULL; + int ret = -1; + + defrag = conf->defrag; + if (defrag->cmd != GF_DEFRAG_CMD_START_TIER) { /* Find local subvolumes */ + ret = syncop_getxattr (this, loc, &dict, + GF_REBAL_FIND_LOCAL_SUBVOL, + NULL, NULL); + if (ret && (ret != -ENODATA)) { + + gf_msg (this->name, GF_LOG_ERROR, -ret, 0, "local " + "subvolume determination failed with error: %d", + -ret); + ret = -1; + goto out; + } + + if (!ret) + goto out; + } + ret = syncop_getxattr (this, loc, &dict, - GF_REBAL_FIND_LOCAL_SUBVOL, + GF_REBAL_OLD_FIND_LOCAL_SUBVOL, NULL, NULL); if (ret) { - gf_msg (this->name, GF_LOG_ERROR, 0, 0, "local " + gf_msg (this->name, GF_LOG_ERROR, -ret, 0, "local " "subvolume determination failed with error: %d", -ret); ret = -1; goto out; } - ret = 0; out: return ret; |