summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-rebalance.c
diff options
context:
space:
mode:
authorMohammed Rafi KC <rkavunga@redhat.com>2015-05-26 10:59:45 +0530
committerDan Lambright <dlambrig@redhat.com>2015-06-19 09:58:49 -0700
commit7aaa414c67be460aca3c1c5eed047e3db17bd435 (patch)
tree944b0cfbaec2e5b28230d36d33c481c2030bb9c3 /xlators/mgmt/glusterd/src/glusterd-rebalance.c
parent2fea88d70b2fb9d479f539509ae930ac6f05eb5c (diff)
glusterd/tier: configure tier daemon during volume restart
rebalance daemon will be running on every tier volume for promoting/demoting the files. When volume/glusterd is restarted, then we need to configure the daemon. Change-Id: Ib565240a70edea2ec8bc1601c52b40c0783491d3 BUG: 1225330 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Signed-off-by: Joseph Fernandes <josferna@redhat.com> Reviewed-on: http://review.gluster.org/10933 Reviewed-by: Dan Lambright <dlambrig@redhat.com> Tested-by: Dan Lambright <dlambrig@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-rebalance.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-rebalance.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-rebalance.c b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
index 0ec1d69..ef003c2 100644
--- a/xlators/mgmt/glusterd/src/glusterd-rebalance.c
+++ b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
@@ -135,7 +135,8 @@ __glusterd_defrag_notify (struct rpc_clnt *rpc, void *mydata,
UNLOCK (&defrag->lock);
if (!gf_is_service_running (pidfile, NULL)) {
- if (volinfo->rebal.defrag_status ==
+ if (volinfo->type != GF_CLUSTER_TYPE_TIER &&
+ volinfo->rebal.defrag_status ==
GF_DEFRAG_STATUS_STARTED) {
volinfo->rebal.defrag_status =
GF_DEFRAG_STATUS_FAILED;
@@ -198,9 +199,6 @@ glusterd_handle_defrag_start (glusterd_volinfo_t *volinfo, char *op_errstr,
GF_ASSERT (volinfo);
GF_ASSERT (op_errstr);
- if ((cmd == GF_OP_CMD_DETACH_START) &&
- (volinfo->rebal.defrag_status == GF_DEFRAG_STATUS_STARTED))
- return 0;
ret = glusterd_defrag_start_validate (volinfo, op_errstr, len, op);
if (ret)
@@ -607,6 +605,13 @@ glusterd_op_stage_rebalance (dict_t *dict, char **op_errstr)
ret = -1;
goto out;
}
+ if (glusterd_is_tier_daemon_running (volinfo)) {
+ ret = gf_asprintf (op_errstr, "A Tier daemon is "
+ "already running on volume %s",
+ volname);
+ ret = -1;
+ goto out;
+ }
case GF_DEFRAG_CMD_START:
case GF_DEFRAG_CMD_START_LAYOUT_FIX:
/* Check if the connected clients are all of version