From ffc15b7ef0631b571be00cdb7d091cac84e314f5 Mon Sep 17 00:00:00 2001 From: Mohammed Rafi KC Date: Fri, 15 May 2015 16:03:00 +0530 Subject: tiering/rebalance: Use separate pid/socket file for tiering When promotion/demotion daemon starts, it uses the same pidfile as rebalance. This patch will introduce a different pid file for the same. Change-Id: Ic484c53f51e00ae6b2d697748a9600b14829e23b BUG: 1221970 Signed-off-by: Mohammed Rafi KC Reviewed-on: http://review.gluster.org/10792 Reviewed-by: Atin Mukherjee Tested-by: Gluster Build System Tested-by: NetBSD Build System --- xlators/mgmt/glusterd/src/glusterd.h | 15 +++++++++++++-- 1 file changed, 13 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 384b6f4186e..bca76970c3a 100644 --- a/xlators/mgmt/glusterd/src/glusterd.h +++ b/xlators/mgmt/glusterd/src/glusterd.h @@ -597,10 +597,19 @@ typedef ssize_t (*gd_serialize_t) (struct iovec outmsg, void *args); STACK_DESTROY (frame->root); \ } while (0) +#define GLUSTERD_GET_DEFRAG_PROCESS(path, volinfo) do { \ + if (volinfo->rebal.defrag_cmd == GF_DEFRAG_CMD_START_TIER) \ + snprintf (path, PATH_MAX, "tier"); \ + else \ + snprintf (path, PATH_MAX, "rebalance"); \ + } while (0) + #define GLUSTERD_GET_DEFRAG_DIR(path, volinfo, priv) do { \ char vol_path[PATH_MAX]; \ + char operation[NAME_MAX]; \ GLUSTERD_GET_VOLUME_DIR(vol_path, volinfo, priv); \ - snprintf (path, PATH_MAX, "%s/rebalance",vol_path); \ + GLUSTERD_GET_DEFRAG_PROCESS(operation, volinfo); \ + snprintf (path, PATH_MAX, "%s/%s", vol_path, operation);\ } while (0) #define GLUSTERD_GET_DEFRAG_SOCK_FILE_OLD(path, volinfo, priv) do { \ @@ -611,8 +620,10 @@ typedef ssize_t (*gd_serialize_t) (struct iovec outmsg, void *args); } while (0) #define GLUSTERD_GET_DEFRAG_SOCK_FILE(path, volinfo) do { \ + char operation[NAME_MAX]; \ + GLUSTERD_GET_DEFRAG_PROCESS(operation, volinfo); \ snprintf (path, UNIX_PATH_MAX, DEFAULT_VAR_RUN_DIRECTORY \ - "/gluster-rebalance-%s.sock", \ + "/gluster-%s-%s.sock", operation, \ uuid_utoa(volinfo->volume_id)); \ } while (0) -- cgit