mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
BUG#50364: FLUSH LOGS crashes the server (rpl.rpl_heartbeat_basic
fails in PB sporadically) The IO thread can concurrently access the relay log IO_CACHE while another thread is performing an FLUSH LOGS procedure. FLUSH LOGS closes and reopens the relay log and while doing so it (re)initializes its IO_CACHE. During this procedure the IO_CACHE mutex is also reinitialized, which can cause problems if some other thread (namely the IO THREAD) is concurrently accessing it at the time . This patch fixes the problem by extending the interface of the flush_master_info function to also include a second paramater, "need_relay_log_lock", stating whether the thread should grab the relay log lock or not before actually flushing the relay log. Also, IO thread now calls flush_master_info with this flag set when it flushes master info with in the event read_event loop. Finally, we also increase loop time in rpl_heartbeat_basic test case, so that the number of calls to flush logs doubles, stressing this part of the code a little more.
This commit is contained in:
@ -120,7 +120,9 @@ int init_master_info(Master_info* mi, const char* master_info_fname,
|
||||
bool abort_if_no_master_info_file,
|
||||
int thread_mask);
|
||||
void end_master_info(Master_info* mi);
|
||||
int flush_master_info(Master_info* mi, bool flush_relay_log_cache);
|
||||
int flush_master_info(Master_info* mi,
|
||||
bool flush_relay_log_cache,
|
||||
bool need_lock_relay_log);
|
||||
int change_master_server_id_cmp(ulong *id1, ulong *id2);
|
||||
|
||||
#endif /* HAVE_REPLICATION */
|
||||
|
Reference in New Issue
Block a user