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 --- xlators/features/trash/src/trash.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'xlators/features/trash') diff --git a/xlators/features/trash/src/trash.c b/xlators/features/trash/src/trash.c index e8f8b7bf051..8a92685cf4b 100644 --- a/xlators/features/trash/src/trash.c +++ b/xlators/features/trash/src/trash.c @@ -2616,16 +2616,24 @@ fini (xlator_t *this) GF_VALIDATE_OR_GOTO ("trash", this, out); priv = this->private; - inode_table = priv->trash_itable; if (priv) { - if (priv->newtrash_dir) + inode_table = priv->trash_itable; + if (priv->newtrash_dir) { GF_FREE (priv->newtrash_dir); - if (priv->oldtrash_dir) + priv->newtrash_dir = NULL; + } + if (priv->oldtrash_dir) { GF_FREE (priv->oldtrash_dir); - if (priv->brick_path) + priv->oldtrash_dir = NULL; + } + if (priv->brick_path) { GF_FREE (priv->brick_path); - if (priv->eliminate) + priv->brick_path = NULL; + } + if (priv->eliminate) { wipe_eliminate_path (&priv->eliminate); + priv->eliminate = NULL; + } if (inode_table) { inode_table_destroy (inode_table); priv->trash_itable = NULL; -- cgit