74b1de
From bbcfd7e28b43845bac675dcc486bde09b0953f64 Mon Sep 17 00:00:00 2001
74b1de
From: Hari Gowtham <hgowtham@redhat.com>
74b1de
Date: Thu, 11 Apr 2019 14:40:11 +0530
74b1de
Subject: [PATCH 088/124] tier: fix failures noticed during tier start and tier
74b1de
 restart.
74b1de
74b1de
Problem 1: when tier is started using the tier start command,
74b1de
the out put was skipped during a failure. failures don't have an
74b1de
transaction id. this id was checked and if its missing then
74b1de
it skips.
74b1de
74b1de
fix: had to remove the unnecessary jump for that case.
74b1de
74b1de
problem 2: When tier was restarted, the tierd doesn't come online.
74b1de
This was because, there were a certain values that were supposed
74b1de
to be stored in glusterd (gluster-store.c) which will be used
74b1de
during restart to come to the original state.
74b1de
These values were stored. as they were missing, tierd didn't come
74b1de
online.
74b1de
74b1de
fix: store the value and make it available during the start.
74b1de
74b1de
Label: DOWNSTREAM ONLY
74b1de
74b1de
Change-Id: I7df898fa4c3b72fe8ded4adbf573307a59a37e5e
74b1de
Signed-off-by: Hari Gowtham <hgowtham@redhat.com>
74b1de
Reviewed-on: https://code.engineering.redhat.com/gerrit/167653
74b1de
Tested-by: RHGS Build Bot <nigelb@redhat.com>
74b1de
Reviewed-by: Sanju Rakonde <srakonde@redhat.com>
74b1de
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
74b1de
---
74b1de
 cli/src/cli-rpc-ops.c                      |  1 -
74b1de
 xlators/mgmt/glusterd/src/glusterd-store.c | 13 +++++++++++++
74b1de
 2 files changed, 13 insertions(+), 1 deletion(-)
74b1de
74b1de
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
74b1de
index 736cd18..b167e26 100644
74b1de
--- a/cli/src/cli-rpc-ops.c
74b1de
+++ b/cli/src/cli-rpc-ops.c
74b1de
@@ -1973,7 +1973,6 @@ gf_cli_defrag_volume_cbk(struct rpc_req *req, struct iovec *iov, int count,
74b1de
         if (ret) {
74b1de
             gf_log("cli", GF_LOG_WARNING, "failed to get %s from dict",
74b1de
                    GF_REBALANCE_TID_KEY);
74b1de
-            goto out;
74b1de
         }
74b1de
         if (rsp.op_ret && strcmp(rsp.op_errstr, "")) {
74b1de
             snprintf(msg, sizeof(msg), "%s", rsp.op_errstr);
74b1de
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c
74b1de
index 351bd9e..4889217 100644
74b1de
--- a/xlators/mgmt/glusterd/src/glusterd-store.c
74b1de
+++ b/xlators/mgmt/glusterd/src/glusterd-store.c
74b1de
@@ -3336,6 +3336,19 @@ glusterd_store_update_volinfo(glusterd_volinfo_t *volinfo)
74b1de
                 break;
74b1de
 
74b1de
             case GF_CLUSTER_TYPE_TIER:
74b1de
+                if (volinfo->tier_info.cold_type ==
74b1de
+                                GF_CLUSTER_TYPE_DISPERSE)
74b1de
+                        volinfo->tier_info.cold_dist_leaf_count
74b1de
+                                = volinfo->disperse_count;
74b1de
+                else
74b1de
+                        volinfo->tier_info.cold_dist_leaf_count
74b1de
+                                = glusterd_calc_dist_leaf_count (
74b1de
+                                                volinfo->tier_info.
74b1de
+                                                cold_replica_count,
74b1de
+                                                1);
74b1de
+
74b1de
+                break;
74b1de
+
74b1de
             case GF_CLUSTER_TYPE_STRIPE:
74b1de
             case GF_CLUSTER_TYPE_STRIPE_REPLICATE:
74b1de
                 gf_msg(this->name, GF_LOG_CRITICAL, ENOTSUP,
74b1de
-- 
74b1de
1.8.3.1
74b1de