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