mirror of
				https://github.com/MariaDB/server.git
				synced 2025-10-31 19:06:14 +01:00 
			
		
		
		
	 592a10d079
			
		
	
	
	592a10d079
	
	
	
		
			
			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()
		
			
				
	
	
		
			17 lines
		
	
	
	
		
			540 B
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
	
		
			540 B
		
	
	
	
		
			Text
		
	
	
	
	
	
| #
 | |
| # 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
 | |
| #
 | |
| # Purpose of this test case to test crash while FTWRL and shutdown is in race
 | |
| # condition
 | |
| # Shutdown can execute first and destroy the mutex making mutex_lock in pool_mark_busy
 | |
| # to crash
 | |
| 
 | |
| --source include/have_debug.inc
 | |
| --connect (con1,localhost,root,,)
 | |
| SET DEBUG_DBUG='+d,mark_busy_mdev_22370';
 | |
| --send
 | |
|   FLUSH TABLES WITH READ LOCK;
 | |
| 
 | |
| --connection default
 | |
| --source include/restart_mysqld.inc
 |