summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMohammed Rafi KC <rkavunga@redhat.com>2015-12-29 12:42:30 +0530
committerAtin Mukherjee <amukherj@redhat.com>2016-01-03 21:19:10 -0800
commitfa4f583e469c065b4e1fb7ddfadfd14e1e6d62ae (patch)
tree2f7b945acdaac7bc5dc99cc36e4a6960af109e8c
parent96f4ec28a80c013b71aa723efaa5810d2eacdd7f (diff)
downloadglusterfs-fa4f583e469c065b4e1fb7ddfadfd14e1e6d62ae.tar.gz
glusterfs-fa4f583e469c065b4e1fb7ddfadfd14e1e6d62ae.tar.xz
glusterfs-fa4f583e469c065b4e1fb7ddfadfd14e1e6d62ae.zip
tier/glusterd: tier daemon not updating the status
Tier process is not updating the status when the process killed mnually. 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>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-rebalance.c3
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c32
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 598c0555c2..5faa6b4a1b 100644
--- a/xlators/mgmt/glusterd/src/glusterd-rebalance.c
+++ b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
@@ -135,8 +135,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 c7183345e2..2e2607b6d0 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -7020,6 +7020,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)
@@ -7042,6 +7067,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: