diff options
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-rebalance.c | 3 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 32 |
2 files changed, 33 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-rebalance.c b/xlators/mgmt/glusterd/src/glusterd-rebalance.c index 5f49e4b8752..2ceab6d6d24 100644 --- a/xlators/mgmt/glusterd/src/glusterd-rebalance.c +++ b/xlators/mgmt/glusterd/src/glusterd-rebalance.c @@ -140,8 +140,7 @@ __glusterd_defrag_notify (struct rpc_clnt *rpc, void *mydata, UNLOCK (&defrag->lock); if (!gf_is_service_running (pidfile, NULL)) { - if (volinfo->type != GF_CLUSTER_TYPE_TIER && - volinfo->rebal.defrag_status == + if (volinfo->rebal.defrag_status == GF_DEFRAG_STATUS_STARTED) { volinfo->rebal.defrag_status = GF_DEFRAG_STATUS_FAILED; diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 23c48bb6a48..0639a910217 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -7071,6 +7071,31 @@ glusterd_get_trusted_client_filepath (char *filepath, return ret; } +void glusterd_update_tier_status (glusterd_volinfo_t *volinfo) { + + glusterd_rebalance_t *rebal = NULL; + + rebal = &volinfo->rebal; + + if (volinfo->type != GF_CLUSTER_TYPE_TIER) + return; + + /* + * If tier process status is stopped or failed, then + * manually changing the status. + */ + + switch (rebal->defrag_status) { + case GF_DEFRAG_STATUS_FAILED: + case GF_DEFRAG_STATUS_STOPPED: + rebal->defrag_status = GF_DEFRAG_STATUS_STARTED; + break; + default: + break; + } + return; +} + int glusterd_volume_defrag_restart (glusterd_volinfo_t *volinfo, char *op_errstr, size_t len, int cmd, defrag_cbk_fn_t cbk) @@ -7093,6 +7118,13 @@ glusterd_volume_defrag_restart (glusterd_volinfo_t *volinfo, char *op_errstr, * there is an existing process already and connect to it. If not, then * start the rebalance process */ + + /* + * Changing the status of tier process to start the daemon + * forcefully. + */ + glusterd_update_tier_status (volinfo); + switch (volinfo->rebal.defrag_status) { case GF_DEFRAG_STATUS_COMPLETE: case GF_DEFRAG_STATUS_STOPPED: |