diff options
author | Jiffin Tony Thottan <jthottan@redhat.com> | 2017-04-19 16:12:10 +0530 |
---|---|---|
committer | Kaleb KEITHLEY <kkeithle@redhat.com> | 2017-04-24 10:33:51 +0000 |
commit | e91cdf4d63893c3cc5506f8fd73f00dc47272dc6 (patch) | |
tree | 7f3a702b07409db7e2e91567378dc5101df80cd1 /xlators | |
parent | d96ab579478ea3bfea6bacced4407a101cc70866 (diff) |
ganesha : allow refresh-config and volume export/unexport in failover state
If ganesha is not running on one of nodes in HA cluster, then alli dbus
commands send to that ganesha server will fail. This results in both
refresh-config and volume export/unepxort failure. This change will
gracefully handle those scenarios.
Change-Id: I3f1b7b7ca98e54c273c266e56357d8e24dd1b14b
BUG: 1443490
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
Reviewed-on: https://review.gluster.org/17081
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: soumya k <skoduri@redhat.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-ganesha.c | 25 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-messages.h | 10 |
2 files changed, 25 insertions, 10 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-ganesha.c b/xlators/mgmt/glusterd/src/glusterd-ganesha.c index 0348f7c280b..64c3d0f6c80 100644 --- a/xlators/mgmt/glusterd/src/glusterd-ganesha.c +++ b/xlators/mgmt/glusterd/src/glusterd-ganesha.c @@ -554,15 +554,22 @@ ganesha_manage_export (dict_t *dict, char *value, char **op_errstr) } if (check_host_list()) { - runner_add_args (&runner, - GANESHA_PREFIX"/dbus-send.sh", - CONFDIR, value, volname, NULL); - ret = runner_run (&runner); - if (ret) { - gf_asprintf(op_errstr, "Dynamic export" - " addition/deletion failed." - " Please see log file for details"); - goto out; + /* Check whether ganesha is running on this node */ + if (manage_service ("status")) { + gf_msg (this->name, GF_LOG_WARNING, 0, + GD_MSG_GANESHA_NOT_RUNNING, + "Export failed, NFS-Ganesha is not running"); + } else { + runner_add_args (&runner, + GANESHA_PREFIX"/dbus-send.sh", + CONFDIR, value, volname, NULL); + ret = runner_run (&runner); + if (ret) { + gf_asprintf(op_errstr, "Dynamic export" + " addition/deletion failed." + " Please see log file for details"); + goto out; + } } } diff --git a/xlators/mgmt/glusterd/src/glusterd-messages.h b/xlators/mgmt/glusterd/src/glusterd-messages.h index 28c73d23d82..b41d91f4ca9 100644 --- a/xlators/mgmt/glusterd/src/glusterd-messages.h +++ b/xlators/mgmt/glusterd/src/glusterd-messages.h @@ -4834,7 +4834,15 @@ * */ -#define GD_MSG_NO_SIG_TO_PID_ZERO (GLUSTERD_COMP_BASE + 597) +#define GD_MSG_GANESHA_NOT_RUNNING (GLUSTERD_COMP_BASE + 597) +/*! + * @messageid + * @diagnosis + * @recommendedaction + * + */ + +#define GD_MSG_NO_SIG_TO_PID_ZERO (GLUSTERD_COMP_BASE + 598) /*------------*/ |