mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
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()
This commit is contained in:
@ -244,6 +244,8 @@ struct rpl_parallel_thread_pool {
|
||||
rpl_parallel_thread_pool();
|
||||
int init(uint32 size);
|
||||
void destroy();
|
||||
void deactivate();
|
||||
void destroy_cond_mutex();
|
||||
struct rpl_parallel_thread *get_thread(rpl_parallel_thread **owner,
|
||||
rpl_parallel_entry *entry);
|
||||
void release_thread(rpl_parallel_thread *rpt);
|
||||
|
Reference in New Issue
Block a user