summaryrefslogtreecommitdiff
path: root/sql/slave.cc
diff options
context:
space:
mode:
authorSachin Kumar <sachin.setiya@mariadb.com>2021-04-14 11:23:38 +0100
committerSachin Kumar <sachin.setiya@mariadb.com>2021-05-14 11:49:46 +0100
commit355dc74b760414fe03e23929507fadc80029edc9 (patch)
tree1fdcac6a1dd8ae3ab197ef9d8d4f76f2936927f5 /sql/slave.cc
parent3616640a3149b318e0d5602dd39f05e309514dbb (diff)
downloadmariadb-git-355dc74b760414fe03e23929507fadc80029edc9.tar.gz
MDEV-22370 safe_mutex: Trying to lock uninitialized mutex at /data/src/10.4-bug/sql/rpl_parallel.cc, line 470 upon shutdown during FTWRL
Problem:- When we issue FTWRL with shutdown in parallel, there is race between FTWRL and shutdown. Shutdown might destroy the mutex (pool->LOCK_rpl_thread_pool) before FTWRL can lock it. So we can get crash on FTWRL thread Solution:- mysql_mutex_destroy(pool->LOCK_rpl_thread_pool) should wait for FTWRL thread to complete its work , and then destroy. So slave_prepare_for_shutdown will just deactivate the pool, and mutex is destroyed later in end_slave()
Diffstat (limited to 'sql/slave.cc')
-rw-r--r--sql/slave.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index 8e26301d926..761fdbe807a 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -977,7 +977,7 @@ void slave_prepare_for_shutdown()
mysql_mutex_unlock(&LOCK_active_mi);
// It's safe to destruct worker pool now when
// all driver threads are gone.
- global_rpl_thread_pool.destroy();
+ global_rpl_thread_pool.deactivate();
}
/*