|
|
d1681e |
From 17b75c3bf216c53b4303a9c59adaf89d3da328ea Mon Sep 17 00:00:00 2001
|
|
|
d1681e |
From: Jiffin Tony Thottan <jthottan@redhat.com>
|
|
|
d1681e |
Date: Wed, 19 Apr 2017 16:12:10 +0530
|
|
|
d1681e |
Subject: [PATCH 57/74] ganesha : allow refresh-config and volume
|
|
|
d1681e |
export/unexport in failover state
|
|
|
d1681e |
|
|
|
d1681e |
If ganesha is not running on one of nodes in HA cluster, then alli dbus
|
|
|
d1681e |
commands send to that ganesha server will fail. This results in both
|
|
|
d1681e |
refresh-config and volume export/unepxort failure. This change will
|
|
|
d1681e |
gracefully handle those scenarios.
|
|
|
d1681e |
|
|
|
d1681e |
Change-Id: I3f1b7b7ca98e54c273c266e56357d8e24dd1b14b
|
|
|
d1681e |
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
|
|
d1681e |
Reviewed-on: https://review.gluster.org/17081
|
|
|
d1681e |
Smoke: Gluster Build System <jenkins@build.gluster.org>
|
|
|
d1681e |
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
|
|
|
d1681e |
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
|
|
|
d1681e |
Reviewed-by: soumya k <skoduri@redhat.com>
|
|
|
d1681e |
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
|
|
|
d1681e |
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
|
|
d1681e |
---
|
|
|
d1681e |
extras/ganesha/scripts/ganesha-ha.sh | 6 ++----
|
|
|
d1681e |
xlators/mgmt/glusterd/src/glusterd-ganesha.c | 25 ++++++++++++++++---------
|
|
|
d1681e |
xlators/mgmt/glusterd/src/glusterd-messages.h | 10 +++++++++-
|
|
|
d1681e |
3 files changed, 27 insertions(+), 14 deletions(-)
|
|
|
d1681e |
|
|
|
d1681e |
diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh
|
|
|
d1681e |
index df4f0b8..db2fa54 100644
|
|
|
d1681e |
--- a/extras/ganesha/scripts/ganesha-ha.sh
|
|
|
d1681e |
+++ b/extras/ganesha/scripts/ganesha-ha.sh
|
|
|
d1681e |
@@ -275,8 +275,7 @@ string:\"EXPORT(Export_Id=$export_id)\" 2>&1")
|
|
|
d1681e |
ret=$?
|
|
|
d1681e |
logger <<< "${output}"
|
|
|
d1681e |
if [ ${ret} -ne 0 ]; then
|
|
|
d1681e |
- echo "Error: refresh-config failed on ${current_host}."
|
|
|
d1681e |
- exit 1
|
|
|
d1681e |
+ echo "Refresh-config failed on ${current_host}"
|
|
|
d1681e |
else
|
|
|
d1681e |
echo "Refresh-config completed on ${current_host}."
|
|
|
d1681e |
fi
|
|
|
d1681e |
@@ -297,8 +296,7 @@ string:"EXPORT(Export_Id=$export_id)" 2>&1)
|
|
|
d1681e |
ret=$?
|
|
|
d1681e |
logger <<< "${output}"
|
|
|
d1681e |
if [ ${ret} -ne 0 ] ; then
|
|
|
d1681e |
- echo "Error: refresh-config failed on localhost."
|
|
|
d1681e |
- exit 1
|
|
|
d1681e |
+ echo "Refresh-config failed on localhost."
|
|
|
d1681e |
else
|
|
|
d1681e |
echo "Success: refresh-config completed."
|
|
|
d1681e |
fi
|
|
|
d1681e |
diff --git a/xlators/mgmt/glusterd/src/glusterd-ganesha.c b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
|
|
|
d1681e |
index 5c582cd..38fa378 100644
|
|
|
d1681e |
--- a/xlators/mgmt/glusterd/src/glusterd-ganesha.c
|
|
|
d1681e |
+++ b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
|
|
|
d1681e |
@@ -554,15 +554,22 @@ ganesha_manage_export (dict_t *dict, char *value, char **op_errstr)
|
|
|
d1681e |
}
|
|
|
d1681e |
|
|
|
d1681e |
if (check_host_list()) {
|
|
|
d1681e |
- runner_add_args (&runner,
|
|
|
d1681e |
- GANESHA_PREFIX"/dbus-send.sh",
|
|
|
d1681e |
- CONFDIR, value, volname, NULL);
|
|
|
d1681e |
- ret = runner_run (&runner);
|
|
|
d1681e |
- if (ret) {
|
|
|
d1681e |
- gf_asprintf(op_errstr, "Dynamic export"
|
|
|
d1681e |
- " addition/deletion failed."
|
|
|
d1681e |
- " Please see log file for details");
|
|
|
d1681e |
- goto out;
|
|
|
d1681e |
+ /* Check whether ganesha is running on this node */
|
|
|
d1681e |
+ if (manage_service ("status")) {
|
|
|
d1681e |
+ gf_msg (this->name, GF_LOG_WARNING, 0,
|
|
|
d1681e |
+ GD_MSG_GANESHA_NOT_RUNNING,
|
|
|
d1681e |
+ "Export failed, NFS-Ganesha is not running");
|
|
|
d1681e |
+ } else {
|
|
|
d1681e |
+ runner_add_args (&runner,
|
|
|
d1681e |
+ GANESHA_PREFIX"/dbus-send.sh",
|
|
|
d1681e |
+ CONFDIR, value, volname, NULL);
|
|
|
d1681e |
+ ret = runner_run (&runner);
|
|
|
d1681e |
+ if (ret) {
|
|
|
d1681e |
+ gf_asprintf(op_errstr, "Dynamic export"
|
|
|
d1681e |
+ " addition/deletion failed."
|
|
|
d1681e |
+ " Please see log file for details");
|
|
|
d1681e |
+ goto out;
|
|
|
d1681e |
+ }
|
|
|
d1681e |
}
|
|
|
d1681e |
}
|
|
|
d1681e |
|
|
|
d1681e |
diff --git a/xlators/mgmt/glusterd/src/glusterd-messages.h b/xlators/mgmt/glusterd/src/glusterd-messages.h
|
|
|
d1681e |
index cc7f371..fb2079f 100644
|
|
|
d1681e |
--- a/xlators/mgmt/glusterd/src/glusterd-messages.h
|
|
|
d1681e |
+++ b/xlators/mgmt/glusterd/src/glusterd-messages.h
|
|
|
d1681e |
@@ -41,7 +41,7 @@
|
|
|
d1681e |
|
|
|
d1681e |
#define GLUSTERD_COMP_BASE GLFS_MSGID_GLUSTERD
|
|
|
d1681e |
|
|
|
d1681e |
-#define GLFS_NUM_MESSAGES 612
|
|
|
d1681e |
+#define GLFS_NUM_MESSAGES 613
|
|
|
d1681e |
|
|
|
d1681e |
#define GLFS_MSGID_END (GLUSTERD_COMP_BASE + GLFS_NUM_MESSAGES + 1)
|
|
|
d1681e |
/* Messaged with message IDs */
|
|
|
d1681e |
@@ -4961,6 +4961,14 @@
|
|
|
d1681e |
*/
|
|
|
d1681e |
#define GD_MSG_PORTS_EXHAUSTED (GLUSTERD_COMP_BASE + 612)
|
|
|
d1681e |
|
|
|
d1681e |
+#define GD_MSG_GANESHA_NOT_RUNNING (GLUSTERD_COMP_BASE + 613)
|
|
|
d1681e |
+/*!
|
|
|
d1681e |
+ * @messageid
|
|
|
d1681e |
+ * @diagnosis
|
|
|
d1681e |
+ * @recommendedaction
|
|
|
d1681e |
+ *
|
|
|
d1681e |
+ */
|
|
|
d1681e |
+
|
|
|
d1681e |
/*------------*/
|
|
|
d1681e |
|
|
|
d1681e |
#define glfs_msg_end_x GLFS_MSGID_END, "Invalid: End of messages"
|
|
|
d1681e |
--
|
|
|
d1681e |
1.8.3.1
|
|
|
d1681e |
|