From a93164cd2a7f7ec37cf30d52b1a73fdc211981c3 Mon Sep 17 00:00:00 2001 From: Avra Sengupta Date: Mon, 24 Nov 2014 08:24:24 +0000 Subject: glusterd/uss: Create rebalance volfile. Create a new rebalance volfile, which will not contain snap-view client translators, irrespective of the status of USS. This volfile, will be created and regenerated everytime the fuse-volfile is generated, and will be consumed by the rebalance process. Change-Id: I514a8e88d06c0b8fb6949c3a3e6dc4dbe55e38af BUG: 1164711 Signed-off-by: Avra Sengupta Reviewed-on: http://review.gluster.org/9190 Tested-by: Gluster Build System Reviewed-by: Rajesh Joseph Reviewed-by: Atin Mukherjee Reviewed-by: Krishnan Parthasarathi Tested-by: Krishnan Parthasarathi --- xlators/mgmt/glusterd/src/glusterd-handshake.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'xlators/mgmt/glusterd/src/glusterd-handshake.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-handshake.c b/xlators/mgmt/glusterd/src/glusterd-handshake.c index 8c9194e1961..8414fa8e9bb 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handshake.c +++ b/xlators/mgmt/glusterd/src/glusterd-handshake.c @@ -230,6 +230,26 @@ build_volfile_path (char *volume_id, char *path, } + volid_ptr = strstr (volume_id, "rebalance/"); + if (volid_ptr) { + volid_ptr = strchr (volid_ptr, '/'); + if (!volid_ptr) { + ret = -1; + goto out; + } + volid_ptr++; + + ret = glusterd_volinfo_find (volid_ptr, &volinfo); + if (ret == -1) { + gf_log (this->name, GF_LOG_ERROR, + "Couldn't find volinfo"); + goto out; + } + glusterd_get_rebalance_volfile (volinfo, path, path_len); + ret = 0; + goto out; + } + if (volume_id[0] == '/') { /* Normal behavior */ volid_ptr = volume_id; -- cgit