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