From 2edf1ec797e6f56515d0208be152d18ca6e71456 Mon Sep 17 00:00:00 2001 From: Kaushal M Date: Mon, 30 Dec 2013 09:59:18 +0530 Subject: glusterd: Relocate rebalance sockfile The defrag sockfile was moved from priv->workdir to DEFAULT_VAR_RUN_DIRECTORY. The format for the new path of the defrag sockfile is 'DEFAULT_VAR_RUN_DIRECTORY/gluster-rebalance-.sock'. This was needed because the earlier location didn't have a fixed length and could exceed UNIX_PATH_MAX characters. This could lead to the rebalance process failing to start as the socket file could not be created. Also, for keeping backward compatiblity, glusterd_rebalance_rpc_create will try both the new and old sockfile locations when attempting reconnection. Change-Id: I6740ea665de84ebce1ef7199c412f426de54e3d0 BUG: 1049726 Signed-off-by: Kaushal M Reviewed-on: http://review.gluster.org/6616 Reviewed-by: Krishnan Parthasarathi Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/mgmt/glusterd/src/glusterd.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd.h') diff --git a/xlators/mgmt/glusterd/src/glusterd.h b/xlators/mgmt/glusterd/src/glusterd.h index ab383ac1c..9b6e2fb33 100644 --- a/xlators/mgmt/glusterd/src/glusterd.h +++ b/xlators/mgmt/glusterd/src/glusterd.h @@ -439,13 +439,19 @@ typedef ssize_t (*gd_serialize_t) (struct iovec outmsg, void *args); snprintf (path, PATH_MAX, "%s/rebalance",vol_path); \ } while (0) -#define GLUSTERD_GET_DEFRAG_SOCK_FILE(path, volinfo, priv) do { \ +#define GLUSTERD_GET_DEFRAG_SOCK_FILE_OLD(path, volinfo, priv) do { \ char defrag_path[PATH_MAX]; \ GLUSTERD_GET_DEFRAG_DIR(defrag_path, volinfo, priv); \ snprintf (path, PATH_MAX, "%s/%s.sock", defrag_path, \ uuid_utoa(MY_UUID)); \ } while (0) +#define GLUSTERD_GET_DEFRAG_SOCK_FILE(path, volinfo) do { \ + snprintf (path, UNIX_PATH_MAX, DEFAULT_VAR_RUN_DIRECTORY \ + "/gluster-rebalance-%s.sock", \ + uuid_utoa(volinfo->volume_id)); \ + } while (0) + #define GLUSTERD_GET_DEFRAG_PID_FILE(path, volinfo, priv) do { \ char defrag_path[PATH_MAX]; \ GLUSTERD_GET_DEFRAG_DIR(defrag_path, volinfo, priv); \ @@ -727,7 +733,8 @@ int glusterd_handle_defrag_start (glusterd_volinfo_t *volinfo, char *op_errstr, size_t len, int cmd, defrag_cbk_fn_t cbk, glusterd_op_t op); int -glusterd_rebalance_rpc_create (glusterd_volinfo_t *volinfo); +glusterd_rebalance_rpc_create (glusterd_volinfo_t *volinfo, + gf_boolean_t reconnect); int glusterd_handle_cli_heal_volume (rpcsvc_request_t *req); -- cgit