summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorMohammed Rafi KC <rkavunga@redhat.com>2015-05-15 16:03:00 +0530
committerKaushal M <kaushal@redhat.com>2015-05-31 21:38:26 -0700
commit3ea46dca41d0a006576214b2d71a462ee6866c4d (patch)
tree0edc03c12c79c96e6237fb7b33584cea89270ee0 /xlators
parent151d01445eddb0bfbd46e13a79b2ed6d1779cc5e (diff)
tiering/rebalance: Use separate pid/socket file for tiering
Back port of http://review.gluster.org/10792 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 <rkavunga@redhat.com> >Reviewed-on: http://review.gluster.org/10792 >Reviewed-by: Atin Mukherjee <amukherj@redhat.com> >Tested-by: Gluster Build System <jenkins@build.gluster.com> >Tested-by: NetBSD Build System Change-Id: Idda13e983ffd443672aee0873ee51e8cc7089c49 BUG: 1221969 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/10980 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Joseph Fernandes Reviewed-by: Kaushal M <kaushal@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/dht/src/tier.c5
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-rebalance.c5
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.h15
3 files changed, 19 insertions, 6 deletions
diff --git a/xlators/cluster/dht/src/tier.c b/xlators/cluster/dht/src/tier.c
index bf481601bd8..dca6c3686a6 100644
--- a/xlators/cluster/dht/src/tier.c
+++ b/xlators/cluster/dht/src/tier.c
@@ -819,8 +819,9 @@ tier_start (xlator_t *this, gf_defrag_info_t *defrag)
}
if (defrag->cmd == GF_DEFRAG_CMD_START_DETACH_TIER) {
- ret = 1;
- gf_msg (this->name, GF_LOG_ERROR, 0,
+ ret = 0;
+ defrag->defrag_status = GF_DEFRAG_STATUS_COMPLETE;
+ gf_msg (this->name, GF_LOG_DEBUG, 0,
DHT_MSG_LOG_TIER_ERROR,
"defrag->defrag_cmd == "
"GF_DEFRAG_CMD_START_DETACH_TIER");
diff --git a/xlators/mgmt/glusterd/src/glusterd-rebalance.c b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
index ac5f139c0b2..f2708f0059d 100644
--- a/xlators/mgmt/glusterd/src/glusterd-rebalance.c
+++ b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
@@ -241,8 +241,9 @@ glusterd_handle_defrag_start (glusterd_volinfo_t *volinfo, char *op_errstr,
GLUSTERD_GET_DEFRAG_SOCK_FILE (sockfile, volinfo);
GLUSTERD_GET_DEFRAG_PID_FILE (pidfile, volinfo, priv);
- snprintf (logfile, PATH_MAX, "%s/%s-rebalance.log",
- DEFAULT_LOG_FILE_DIRECTORY, volinfo->volname);
+ snprintf (logfile, PATH_MAX, "%s/%s-%s.log",
+ DEFAULT_LOG_FILE_DIRECTORY, volinfo->volname,
+ (cmd == GF_DEFRAG_CMD_START_TIER ? "tier":"rebalance"));
runinit (&runner);
if (priv->valgrind) {
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)