From 0043c63f70776444f69667a4ef9596217ecb42b7 Mon Sep 17 00:00:00 2001 From: Mohit Agrawal Date: Mon, 12 Mar 2018 19:43:15 +0530 Subject: gluster: Sometimes Brick process is crashed at the time of stopping brick Problem: Sometimes brick process is getting crashed at the time of stop brick while brick mux is enabled. Solution: Brick process was getting crashed because of rpc connection was not cleaning properly while brick mux is enabled.In this patch after sending GF_EVENT_CLEANUP notification to xlator(server) waits for all rpc client connection destroy for specific xlator.Once rpc connections are destroyed in server_rpc_notify for all associated client for that brick then call xlator_mem_cleanup for for brick xlator as well as all child xlators.To avoid races at the time of cleanup introduce two new flags at each xlator cleanup_starting, call_cleanup. BUG: 1544090 Signed-off-by: Mohit Agrawal Note: Run all test-cases in separate build (https://review.gluster.org/#/c/19700/) with same patch after enable brick mux forcefully, all test cases are passed. Change-Id: Ic4ab9c128df282d146cf1135640281fcb31997bf updates: bz#1544090 --- libglusterfs/src/xlator.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'libglusterfs/src/xlator.c') diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c index 466be5e3a3a..ced89c71672 100644 --- a/libglusterfs/src/xlator.c +++ b/libglusterfs/src/xlator.c @@ -629,7 +629,7 @@ get_xlator_by_name_or_type (xlator_t *this, char *target, int is_name) for (trav = this->children; trav; trav = trav->next) { value = is_name ? trav->xlator->name : trav->xlator->type; - if (strcmp(value, target) == 0) { + if (!strcmp(value, target)) { return trav->xlator; } child_xl = get_xlator_by_name_or_type (trav->xlator, target, @@ -722,7 +722,9 @@ xlator_init (xlator_t *xl) } xl->init_succeeded = 1; - + /*xl->cleanup_starting = 0; + xl->call_cleanup = 0; + */ ret = 0; out: return ret; @@ -858,7 +860,7 @@ xlator_list_destroy (xlator_list_t *list) return 0; } -static int +int xlator_memrec_free (xlator_t *xl) { uint32_t i = 0; -- cgit