d1681e
From 88ed6bd3e752a028b5372aa948a191fa49377459 Mon Sep 17 00:00:00 2001
d1681e
From: Atin Mukherjee <amukherj@redhat.com>
d1681e
Date: Fri, 10 Nov 2017 19:17:27 +0530
d1681e
Subject: [PATCH 35/74] glusterd: regenerate volfiles on op-version bump up
d1681e
d1681e
Please note that LOC of downstream patch differs because of a
d1681e
downstream only fix https://code.engineering.redhat.com/gerrit/94006
d1681e
d1681e
Label: DOWNSTREAM ONLY
d1681e
d1681e
>Reviewed-on: https://review.gluster.org/16455
d1681e
>NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
d1681e
>Smoke: Gluster Build System <jenkins@build.gluster.org>
d1681e
>CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
d1681e
>Reviewed-by: Prashanth Pai <ppai@redhat.com>
d1681e
>Reviewed-by: Kaushal M <kaushal@redhat.com>
d1681e
d1681e
Change-Id: I2fe7a3ebea19492d52253ad5a1fdd67ac95c71c8
d1681e
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
d1681e
Reviewed-on: https://code.engineering.redhat.com/gerrit/96368
d1681e
Reviewed-by: Samikshan Bairagya <sbairagy@redhat.com>
d1681e
Reviewed-by: Prashanth Pai <ppai@redhat.com>
d1681e
---
d1681e
 xlators/mgmt/glusterd/src/glusterd-op-sm.c | 38 ++++++++++--------------------
d1681e
 1 file changed, 13 insertions(+), 25 deletions(-)
d1681e
d1681e
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
d1681e
index 4fc719a..96e0860 100644
d1681e
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
d1681e
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
d1681e
@@ -2612,7 +2612,8 @@ glusterd_op_set_all_volume_options (xlator_t *this, dict_t *dict,
d1681e
                                               NULL);
d1681e
                                 if (ret)
d1681e
                                         goto out;
d1681e
-                                ret = glusterd_update_volumes_dict (volinfo);
d1681e
+                                ret = glusterd_update_volumes_dict
d1681e
+                                                (volinfo, &start_nfs_svc);
d1681e
                                 if (ret)
d1681e
                                         goto out;
d1681e
                                 if (!volinfo->is_snap_volume) {
d1681e
@@ -2622,14 +2623,6 @@ glusterd_op_set_all_volume_options (xlator_t *this, dict_t *dict,
d1681e
                                         if (ret)
d1681e
                                                 goto out;
d1681e
                                 }
d1681e
-
d1681e
-                                if (volinfo->type == GF_CLUSTER_TYPE_TIER) {
d1681e
-                                        svc = &(volinfo->tierd.svc);
d1681e
-                                        ret = svc->reconfigure (volinfo);
d1681e
-                                        if (ret)
d1681e
-                                                goto out;
d1681e
-                                }
d1681e
-
d1681e
                                 ret = glusterd_create_volfiles_and_notify_services (volinfo);
d1681e
                                 if (ret) {
d1681e
                                         gf_msg (this->name, GF_LOG_ERROR, 0,
d1681e
@@ -2651,6 +2644,17 @@ glusterd_op_set_all_volume_options (xlator_t *this, dict_t *dict,
d1681e
                                         }
d1681e
                                 }
d1681e
                         }
d1681e
+                        if (start_nfs_svc) {
d1681e
+                                ret = conf->nfs_svc.manager (&(conf->nfs_svc),
d1681e
+                                                             NULL,
d1681e
+                                                             PROC_START_NO_WAIT);
d1681e
+                                if (ret) {
d1681e
+                                        gf_msg (this->name, GF_LOG_ERROR, 0,
d1681e
+                                                GD_MSG_SVC_START_FAIL,
d1681e
+                                                 "unable to start nfs service");
d1681e
+                                        goto out;
d1681e
+                                }
d1681e
+                        }
d1681e
                         ret = glusterd_store_global_info (this);
d1681e
                         if (ret) {
d1681e
                                 gf_msg (this->name, GF_LOG_ERROR, 0,
d1681e
@@ -2658,22 +2662,6 @@ glusterd_op_set_all_volume_options (xlator_t *this, dict_t *dict,
d1681e
                                         "Failed to store op-version.");
d1681e
                         }
d1681e
                 }
d1681e
-                cds_list_for_each_entry (volinfo, &conf->volumes, vol_list) {
d1681e
-                        ret = glusterd_update_volumes_dict (volinfo,
d1681e
-                                                            &start_nfs_svc);
d1681e
-                        if (ret)
d1681e
-                                goto out;
d1681e
-                }
d1681e
-                if (start_nfs_svc) {
d1681e
-                        ret = conf->nfs_svc.manager (&(conf->nfs_svc), NULL,
d1681e
-                                                     PROC_START_NO_WAIT);
d1681e
-                        if (ret) {
d1681e
-                                gf_msg (this->name, GF_LOG_ERROR, 0,
d1681e
-                                        GD_MSG_SVC_START_FAIL,
d1681e
-                                         "unable to start nfs service");
d1681e
-                                goto out;
d1681e
-                        }
d1681e
-                }
d1681e
                 /* No need to save cluster.op-version in conf->opts
d1681e
                  */
d1681e
                 goto out;
d1681e
-- 
d1681e
1.8.3.1
d1681e