|
|
d1681e |
From 52798b6934ea584b25b1ade64cb52a7439c1b113 Mon Sep 17 00:00:00 2001
|
|
|
d1681e |
From: Atin Mukherjee <amukherj@redhat.com>
|
|
|
d1681e |
Date: Tue, 3 Jan 2017 18:13:29 +0530
|
|
|
d1681e |
Subject: [PATCH 27/74] glusterd: spawn nfs daemon in op-version bump if
|
|
|
d1681e |
nfs.disable key is absent
|
|
|
d1681e |
|
|
|
d1681e |
3.2.0 onwards gNFS will be disabled by default. However any cluster
|
|
|
d1681e |
upgraded to 3.2.0 with existing volumes exposed over gNFS should
|
|
|
d1681e |
continue to have gNFS access and hence post upgrade gNFS service should
|
|
|
d1681e |
come up after bumping up the op-version. Although the key nfs.disable
|
|
|
d1681e |
was handled and managed correctly in the upgrade path but gNFS daemon
|
|
|
d1681e |
was never spawned in this case.
|
|
|
d1681e |
|
|
|
d1681e |
Fix is to spawn gNFS daemon in op-version bump up code path if
|
|
|
d1681e |
nfs.disable option is not set.
|
|
|
d1681e |
|
|
|
d1681e |
Label : DOWNSTREAM ONLY
|
|
|
d1681e |
|
|
|
d1681e |
Change-Id: Icac6f3653160f79b271f25f5df0c89690917e702
|
|
|
d1681e |
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
|
|
|
d1681e |
Reviewed-on: https://code.engineering.redhat.com/gerrit/94006
|
|
|
d1681e |
Reviewed-by: Jiffin Thottan <jthottan@redhat.com>
|
|
|
d1681e |
Reviewed-by: Samikshan Bairagya <sbairagy@redhat.com>
|
|
|
d1681e |
---
|
|
|
d1681e |
xlators/mgmt/glusterd/src/glusterd-messages.h | 8 ++++++
|
|
|
d1681e |
xlators/mgmt/glusterd/src/glusterd-op-sm.c | 35 ++++++++++++++++++++++++---
|
|
|
d1681e |
2 files changed, 40 insertions(+), 3 deletions(-)
|
|
|
d1681e |
|
|
|
d1681e |
diff --git a/xlators/mgmt/glusterd/src/glusterd-messages.h b/xlators/mgmt/glusterd/src/glusterd-messages.h
|
|
|
d1681e |
index 65d4353..8bb4c43 100644
|
|
|
d1681e |
--- a/xlators/mgmt/glusterd/src/glusterd-messages.h
|
|
|
d1681e |
+++ b/xlators/mgmt/glusterd/src/glusterd-messages.h
|
|
|
d1681e |
@@ -4937,6 +4937,14 @@
|
|
|
d1681e |
*/
|
|
|
d1681e |
#define GD_MSG_GARBAGE_ARGS (GLUSTERD_COMP_BASE + 611)
|
|
|
d1681e |
|
|
|
d1681e |
+/*!
|
|
|
d1681e |
+ * @messageid
|
|
|
d1681e |
+ * @diagnosis
|
|
|
d1681e |
+ * @recommendedaction
|
|
|
d1681e |
+ *
|
|
|
d1681e |
+ */
|
|
|
d1681e |
+#define GD_MSG_SVC_START_FAIL (GLUSTERD_COMP_BASE + 590)
|
|
|
d1681e |
+
|
|
|
d1681e |
/*------------*/
|
|
|
d1681e |
|
|
|
d1681e |
#define glfs_msg_end_x GLFS_MSGID_END, "Invalid: End of messages"
|
|
|
d1681e |
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
|
|
|
d1681e |
index 0557ad8..4fc719a 100644
|
|
|
d1681e |
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
|
|
|
d1681e |
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
|
|
|
d1681e |
@@ -2423,7 +2423,8 @@ out:
|
|
|
d1681e |
}
|
|
|
d1681e |
|
|
|
d1681e |
static int
|
|
|
d1681e |
-glusterd_update_volumes_dict (glusterd_volinfo_t *volinfo)
|
|
|
d1681e |
+glusterd_update_volumes_dict (glusterd_volinfo_t *volinfo,
|
|
|
d1681e |
+ gf_boolean_t *start_nfs_svc)
|
|
|
d1681e |
{
|
|
|
d1681e |
int ret = -1;
|
|
|
d1681e |
xlator_t *this = NULL;
|
|
|
d1681e |
@@ -2436,6 +2437,8 @@ glusterd_update_volumes_dict (glusterd_volinfo_t *volinfo)
|
|
|
d1681e |
conf = this->private;
|
|
|
d1681e |
GF_VALIDATE_OR_GOTO (this->name, conf, out);
|
|
|
d1681e |
|
|
|
d1681e |
+ ret = 0;
|
|
|
d1681e |
+
|
|
|
d1681e |
/* 3.9.0 onwards gNFS will be disabled by default. In case of an upgrade
|
|
|
d1681e |
* from anything below than 3.9.0 to 3.9.x, the value for nfs.disable is
|
|
|
d1681e |
* set to 'off' for all volumes even if it is not explicitly set in the
|
|
|
d1681e |
@@ -2458,6 +2461,12 @@ glusterd_update_volumes_dict (glusterd_volinfo_t *volinfo)
|
|
|
d1681e |
"volume %s", volinfo->volname);
|
|
|
d1681e |
goto out;
|
|
|
d1681e |
}
|
|
|
d1681e |
+ /* If the volume is started then mark start_nfs_svc to
|
|
|
d1681e |
+ * true such that nfs daemon can be spawned up
|
|
|
d1681e |
+ */
|
|
|
d1681e |
+ if (GLUSTERD_STATUS_STARTED == volinfo->status)
|
|
|
d1681e |
+ *start_nfs_svc = _gf_true;
|
|
|
d1681e |
+
|
|
|
d1681e |
}
|
|
|
d1681e |
|
|
|
d1681e |
ret = dict_get_str (volinfo->dict, "transport.address-family",
|
|
|
d1681e |
@@ -2478,9 +2487,12 @@ glusterd_update_volumes_dict (glusterd_volinfo_t *volinfo)
|
|
|
d1681e |
}
|
|
|
d1681e |
}
|
|
|
d1681e |
}
|
|
|
d1681e |
+ ret = glusterd_store_volinfo (volinfo,
|
|
|
d1681e |
+ GLUSTERD_VOLINFO_VER_AC_INCREMENT);
|
|
|
d1681e |
+ if (ret)
|
|
|
d1681e |
+ goto out;
|
|
|
d1681e |
+
|
|
|
d1681e |
}
|
|
|
d1681e |
- ret = glusterd_store_volinfo (volinfo,
|
|
|
d1681e |
- GLUSTERD_VOLINFO_VER_AC_INCREMENT);
|
|
|
d1681e |
|
|
|
d1681e |
out:
|
|
|
d1681e |
return ret;
|
|
|
d1681e |
@@ -2529,6 +2541,7 @@ glusterd_op_set_all_volume_options (xlator_t *this, dict_t *dict,
|
|
|
d1681e |
uint32_t op_version = 0;
|
|
|
d1681e |
glusterd_volinfo_t *volinfo = NULL;
|
|
|
d1681e |
glusterd_svc_t *svc = NULL;
|
|
|
d1681e |
+ gf_boolean_t start_nfs_svc = _gf_false;
|
|
|
d1681e |
|
|
|
d1681e |
conf = this->private;
|
|
|
d1681e |
ret = dict_get_str (dict, "key1", &key);
|
|
|
d1681e |
@@ -2645,6 +2658,22 @@ 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 |
|