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