From dba55ae364a2772904bb68a6bd0ea87289ee1470 Mon Sep 17 00:00:00 2001 From: Mohit Agrawal Date: Thu, 25 May 2017 21:43:42 +0530 Subject: glusterfs: Not able to mount running volume after enable brick mux and stopped any volume Problem: After enabled brick mux if any volume has down and then try ot run mount with running volume , mount command is hung. Solution: After enable brick mux server has shared one data structure server_conf for all associated subvolumes.After down any subvolume in some ungraceful manner (remove brick directory) posix xlator sends GF_EVENT_CHILD_DOWN event to parent xlatros and server notify updates the child_up to false in server_conf.When client is trying to communicate with server through mount it checks conf->child_up and it is FALSE so it throws message "translator are not yet ready". From this patch updated structure server_conf to save child_up status for xlator wise. Another improtant correction from this patch is cleanup threads from server side xlators after stop the volume. BUG: 1453977 Change-Id: Ic54da3f01881b7c9429ce92cc569236eb1d43e0d Signed-off-by: Mohit Agrawal Reviewed-on: https://review.gluster.org/17356 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Raghavendra Talur CentOS-regression: Gluster Build System Reviewed-by: Jeff Darcy --- xlators/features/bit-rot/src/stub/bit-rot-stub.c | 31 ++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'xlators/features/bit-rot/src') diff --git a/xlators/features/bit-rot/src/stub/bit-rot-stub.c b/xlators/features/bit-rot/src/stub/bit-rot-stub.c index 895e7690a5e..b8a34422522 100644 --- a/xlators/features/bit-rot/src/stub/bit-rot-stub.c +++ b/xlators/features/bit-rot/src/stub/bit-rot-stub.c @@ -10,6 +10,7 @@ #include #include +#include #include "glusterfs.h" #include "xlator.h" @@ -212,6 +213,35 @@ out: return ret; } + +int +notify (xlator_t *this, int event, void *data, ...) +{ + br_stub_private_t *priv = NULL; + + if (!this) + return 0; + + priv = this->private; + if (!priv) + return 0; + + switch (event) { + case GF_EVENT_CLEANUP: + if (priv->signth) { + (void) gf_thread_cleanup_xint (priv->signth); + priv->signth = 0; + } + if (priv->container.thread) { + (void) gf_thread_cleanup_xint (priv->container.thread); + priv->container.thread = 0; + } + break; + } + default_notify (this, event, data); + return 0; +} + void fini (xlator_t *this) { @@ -832,6 +862,7 @@ br_stub_signth (void *arg) THIS = this; while (1) { + pthread_mutex_lock (&priv->lock); { while (list_empty (&priv->squeue)) -- cgit