summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-rebalance.c
diff options
context:
space:
mode:
authorSusant Palai <spalai@redhat.com>2017-06-21 17:52:45 +0530
committerShyamsundar Ranganathan <srangana@redhat.com>2017-06-26 10:47:00 +0000
commit4700c5be55b0e567755b4c8a1a91f33d29c06e6b (patch)
treec0f85caba100c9f9d46dd61f3cdd96c407a19d5a /xlators/cluster/dht/src/dht-rebalance.c
parentd66fb14a952729caf51c8328448a548c4d198082 (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 Change-Id: I4d602feda2a05b29d2210c712a07a4ac6b8bc112 BUG: 1463648 Signed-off-by: Susant Palai <spalai@redhat.com> Signed-off-by: N Balachandran <nbalacha@redhat.com> Reviewed-on: https://review.gluster.org/17595 Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> 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.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c
index 7bbd5956028..09bfac2dd1f 100644
--- a/xlators/cluster/dht/src/dht-rebalance.c
+++ b/xlators/cluster/dht/src/dht-rebalance.c
@@ -4037,21 +4037,41 @@ 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, -ret, 0, "local "
"subvolume determination failed with error: %d",
-ret);
ret = -1;
goto out;
}
-
ret = 0;
out:
return ret;