summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht.c
diff options
context:
space:
mode:
authorshishirng <shishirng@gluster.com>2012-03-06 18:55:37 +0530
committerVijay Bellur <vijay@gluster.com>2012-03-07 21:14:27 -0800
commit33e9f9da8546dc57ecf6b3705f6b6474150ec78c (patch)
tree9455c2dcd9f49e7ff8b50fdcc3fb6d8b0534c975 /xlators/cluster/dht/src/dht.c
parentf6a779ffc5b515163995dc2d240c3271cc6bceeb (diff)
glusterd/rebalance: Bring in support for parallel rebalance
This patch, enables rebalance processes to be started on all nodes where the volume is spread across (1 process per node) node-uuid xattr identifies which node takes ownership of the task to migrate the file. The model employed is push (src pushes to dst) Change-Id: Ieacd46a6216cf6ded841bbaebd10cfaea51c16d6 BUG: 763844 Signed-off-by: shishirng <shishirng@gluster.com> Reviewed-on: http://review.gluster.com/2873 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht.c')
-rw-r--r--xlators/cluster/dht/src/dht.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht.c b/xlators/cluster/dht/src/dht.c
index 4502a751b49..96382bf16e0 100644
--- a/xlators/cluster/dht/src/dht.c
+++ b/xlators/cluster/dht/src/dht.c
@@ -359,6 +359,7 @@ init (xlator_t *this)
int i = 0;
gf_defrag_info_t *defrag = NULL;
int cmd = 0;
+ char *node_uuid = NULL;
GF_VALIDATE_OR_GOTO ("dht", this, err);
@@ -391,6 +392,19 @@ init (xlator_t *this)
defrag->is_exiting = 0;
+ ret = dict_get_str (this->options, "node-uuid", &node_uuid);
+ if (ret) {
+ gf_log (this->name, GF_LOG_ERROR, "node-uuid not "
+ "specified");
+ goto err;
+ }
+
+ if (uuid_parse (node_uuid, defrag->node_uuid)) {
+ gf_log (this->name, GF_LOG_ERROR, "Cannot parse "
+ "glusterd node uuid");
+ goto err;
+ }
+
defrag->cmd = cmd;
conf->defrag = defrag;
@@ -591,6 +605,9 @@ struct volume_options options[] = {
{ .key = {"rebalance-cmd"},
.type = GF_OPTION_TYPE_INT,
},
+ { .key = {"node-uuid"},
+ .type = GF_OPTION_TYPE_STR,
+ },
{ .key = {NULL} },
};