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