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