diff options
author | Mohammed Rafi KC <rkavunga@redhat.com> | 2015-12-29 12:42:30 +0530 |
---|---|---|
committer | Dan Lambright <dlambrig@redhat.com> | 2016-02-22 06:50:04 -0800 |
commit | d48f1640b7c3932e0dfa979df8f25a5062ec4c37 (patch) | |
tree | 74f06fab4f6d45f70b854d8b28ccf17a65d612af /xlators/mgmt | |
parent | 4baa960b95a33af30de1ca90d9b37b04e10fd0ff (diff) |
tier/glusterd: tier daemon not updating the status
Tier process is not updating the status when the process killed
mnually.
backport of>
>Change-Id: Ia5ea903af78ff3582da2242e6058f11c71923fab
>BUG: 1294600
>Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
>Reviewed-on: http://review.gluster.org/13107
>Tested-by: Gluster Build System <jenkins@build.gluster.com>
>Tested-by: NetBSD Build System <jenkins@build.gluster.org>
>Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Change-Id: I208953af5ee7985ad5b01a434ef0c94fefb0af2d
BUG: 1295365
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Reviewed-on: http://review.gluster.org/13165
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Smoke: Gluster Build System <jenkins@build.gluster.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Diffstat (limited to 'xlators/mgmt')
-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: |