summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-rebalance.c
diff options
context:
space:
mode:
authoranand <anekkunt@redhat.com>2015-06-13 16:46:10 +0530
committerAtin Mukherjee <amukherj@redhat.com>2015-07-16 23:39:58 -0700
commitee824ccb10e28489907fbf978a2d36b0b2c5dc8c (patch)
treeb7f7b77475460ac01b1a5581bbe47e321c18b14a /xlators/mgmt/glusterd/src/glusterd-rebalance.c
parent4cdeee511ef8bab977cbb31bc2e8f005fe340ef1 (diff)
glusterd: rebalance support for cluster.rc framework
Issue:Rebalance is failing in cluster framework (any simulated cluster environment in same node ). RCA: 1. we are passing always "localhost" as volfile server for rebalance xlator . 2. Rebalance daemons are overwriting unix socket and log files each other. (All rebalance processes are creating socket with same name) . Fix: set vol_file_server, unix socket and log files properly. Change-Id: I6654461e00c2a164b2f1f1db24a316c4180dd8d5 BUG: 1231437 Signed-off-by: anand <anekkunt@redhat.com> Reviewed-on: http://review.gluster.org/11210 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-rebalance.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-rebalance.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-rebalance.c b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
index 03cc53c..c4674f5 100644
--- a/xlators/mgmt/glusterd/src/glusterd-rebalance.c
+++ b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
@@ -193,6 +193,7 @@ glusterd_handle_defrag_start (glusterd_volinfo_t *volinfo, char *op_errstr,
char logfile[PATH_MAX] = {0,};
char volname[PATH_MAX] = {0,};
char valgrind_logfile[PATH_MAX] = {0,};
+ char *volfileserver = NULL;
priv = THIS->private;
@@ -253,8 +254,26 @@ glusterd_handle_defrag_start (glusterd_volinfo_t *volinfo, char *op_errstr,
}
snprintf (volname, sizeof(volname), "rebalance/%s", volinfo->volname);
+
+ if (dict_get_str (THIS->options, "transport.socket.bind-address",
+ &volfileserver) == 0) {
+ /*In the case of running multiple glusterds on a single machine,
+ *we should ensure that log file and unix socket file shouls be
+ *unique in given cluster */
+
+ GLUSTERD_GET_DEFRAG_SOCK_FILE_OLD (sockfile, volinfo,
+ priv);
+ snprintf (logfile, PATH_MAX, "%s/%s-%s-%s.log",
+ DEFAULT_LOG_FILE_DIRECTORY, volinfo->volname,
+ (cmd == GF_DEFRAG_CMD_START_TIER ? "tier":"rebalance"),
+ uuid_utoa(MY_UUID));
+
+ } else {
+ volfileserver = "localhost";
+ }
+
runner_add_args (&runner, SBIN_DIR"/glusterfs",
- "-s", "localhost", "--volfile-id", volname,
+ "-s", volfileserver, "--volfile-id", volname,
"--xlator-option", "*dht.use-readdirp=yes",
"--xlator-option", "*dht.lookup-unhashed=yes",
"--xlator-option", "*dht.assert-no-child-down=yes",