74b1de
From 302f3f87c9aa00c17ec3b49a81c8a4441d2bdf5f Mon Sep 17 00:00:00 2001
74b1de
From: Hari Gowtham <hgowtham@redhat.com>
74b1de
Date: Mon, 15 Apr 2019 10:01:40 +0530
74b1de
Subject: [PATCH 097/124] glusterd/tier: while doing an attach tier, the self
74b1de
 heal daemon is not getting started
74b1de
74b1de
Problem: on a replicated volume, if attach tier is done,
74b1de
The shd will be restarted. But here the restart fails because of the
74b1de
graph not getting generated properly. The dict which is used for graph
74b1de
creation doesn't get the values copied properly in prepare_shd_volume_options()
74b1de
glusterd_prepare_shd_volume_options_for_tier() fails and skips the copy.
74b1de
74b1de
This patch reverts the changes back to the way it was in 3.4 and
74b1de
help in fixing the issue. Using the old dict_set_str works.
74b1de
74b1de
label: DOWNSTREAM ONLY
74b1de
74b1de
Change-Id: I21534ca177511e018ba76886e899b3b1a4ac4716
74b1de
Signed-off-by: Hari Gowtham <hgowtham@redhat.com>
74b1de
Reviewed-on: https://code.engineering.redhat.com/gerrit/167825
74b1de
Tested-by: RHGS Build Bot <nigelb@redhat.com>
74b1de
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
74b1de
---
74b1de
 xlators/mgmt/glusterd/src/glusterd-volgen.c | 19 +++++++++++++------
74b1de
 1 file changed, 13 insertions(+), 6 deletions(-)
74b1de
74b1de
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
74b1de
index 012f38e..1f53beb 100644
74b1de
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
74b1de
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
74b1de
@@ -4895,14 +4895,21 @@ glusterd_prepare_shd_volume_options_for_tier(glusterd_volinfo_t *volinfo,
74b1de
                                              dict_t *set_dict)
74b1de
 {
74b1de
     int ret = -1;
74b1de
+    char           *key             = NULL;
74b1de
 
74b1de
-    ret = volgen_set_shd_key_enable(set_dict, volinfo->tier_info.cold_type);
74b1de
-    if (ret)
74b1de
-        goto out;
74b1de
+    key = volgen_get_shd_key (volinfo->tier_info.cold_type);
74b1de
+    if (key) {
74b1de
+        ret = dict_set_str (set_dict, key, "enable");
74b1de
+        if (ret)
74b1de
+            goto out;
74b1de
+    }
74b1de
 
74b1de
-    ret = volgen_set_shd_key_enable(set_dict, volinfo->tier_info.hot_type);
74b1de
-    if (ret)
74b1de
-        goto out;
74b1de
+    key = volgen_get_shd_key (volinfo->tier_info.hot_type);
74b1de
+    if (key) {
74b1de
+        ret = dict_set_str (set_dict, key, "enable");
74b1de
+        if (ret)
74b1de
+            goto out;
74b1de
+    }
74b1de
 out:
74b1de
     return ret;
74b1de
 }
74b1de
-- 
74b1de
1.8.3.1
74b1de