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