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