mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-4506: Parallel replication
MDEV-5217: SQL thread hangs during stop if error occurs in the middle of an event group Normally, when we stop the slave SQL thread in parallel replication, we want the worker threads to continue processing events until the end of the current event group. But if we stop due to an error that prevents further events from being queued, such as an error reading the relay log, no more events can be queued for the workers, so they have to abort even if they are in the middle of an event group. There was a bug that we would deadlock, the workers waiting for more events to be queued for the event group, the SQL thread stopped and waiting for the workers to complete their current event group before exiting. Fixed by now signalling from the SQL thread to all workers when it is about to exit, and cleaning up in all workers when so signalled. This patch fixes one of multiple problems reported in MDEV-5217.
This commit is contained in:
@ -76,6 +76,13 @@ struct rpl_parallel_entry {
|
||||
uint64 last_seq_no;
|
||||
uint64 last_commit_id;
|
||||
bool active;
|
||||
/*
|
||||
Set when SQL thread is shutting down, and no more events can be processed,
|
||||
so worker threads must force abort any current transactions without
|
||||
waiting for event groups to complete.
|
||||
*/
|
||||
bool force_abort;
|
||||
|
||||
rpl_parallel_thread *rpl_thread;
|
||||
/*
|
||||
The sub_id of the last transaction to commit within this domain_id.
|
||||
|
Reference in New Issue
Block a user