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