summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
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)