summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt
diff options
context:
space:
mode:
authorEmmanuel Dreyfus <manu@netbsd.org>2014-09-06 03:08:20 +0200
committerVijay Bellur <vbellur@redhat.com>2014-09-07 23:19:08 -0700
commit467446c6837debff2caacfdb889adc69e9c702ae (patch)
tree62847628cf5361a04e5cdbb3528aa174731031c1 /xlators/mgmt
parente3817aa6cab71e42f7e611d75abf0f433b88d907 (diff)
Fix glustershd detection on volume restart
On NetBSD and FreeBSD, doing a 'gluster volume start $volume force' causes NFS server, quotad, snapd and glustershd to be undetected by glusterd once the volume has restarted. 'gluster volume status' shows the three processes as 'N' in the online column, while they have been launched successfully. This happens because glusterd attempts to connect to its child processes just between the child does a unlink() on the socket in __socket_server_bind() and the time it calls bind() and listen(). Different scheduling policy may explain why the problem does not happen on Linux, but it may pop up some day since we make no guaranteed assumptions here. This patchet works this around by introducing a boolean transport.socket.ignore-enoent option, set by nfs and glustershd, which prevents ENOENT to be fatal and cause glusterd to retry and suceed later. Behavior of other clients is unaffected. This is a backport of Ifdc4d45b2513743ed42ee235a5c61a086321644c BUG: 1138897 Change-Id: I04472f045249c99a9492218ceebfab847474db2d Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/8630 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 7eddb753dc6..9efef4ca0ce 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -5872,6 +5872,15 @@ glusterd_nodesvc_connect (char *server, char *socketpath)
600);
if (ret)
goto out;
+
+ if (!strcmp(server, "glustershd") ||
+ !strcmp(server, "nfs") ||
+ !strcmp(server, "quotad")) {
+ ret = dict_set_str(options, "transport.socket.ignore-enoent", "on");
+ if (ret)
+ goto out;
+ }
+
ret = glusterd_rpc_create (&rpc, options,
glusterd_nodesvc_rpc_notify,
server);
@@ -13044,6 +13053,11 @@ glusterd_snapd_connect (glusterd_volinfo_t *volinfo, char *socketpath)
if (ret)
goto out;
+ ret = dict_set_str(options,
+ "transport.socket.ignore-enoent", "on");
+ if (ret)
+ goto out;
+
glusterd_volinfo_ref (volinfo);
synclock_unlock (&priv->big_lock);