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