summaryrefslogtreecommitdiff
path: root/sql/rpl_parallel.h
diff options
context:
space:
mode:
authorunknown <knielsen@knielsen-hq.org>2013-11-05 12:01:26 +0100
committerunknown <knielsen@knielsen-hq.org>2013-11-05 12:01:26 +0100
commitc834242ad42e3b7a4ed3a1a5de086754acbe52a1 (patch)
tree026d77a1e29793353622bee3da0724c753fca604 /sql/rpl_parallel.h
parentbf603250b02c936a271d628c93078cba3d081823 (diff)
downloadmariadb-git-c834242ad42e3b7a4ed3a1a5de086754acbe52a1.tar.gz
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.
Diffstat (limited to 'sql/rpl_parallel.h')
-rw-r--r--sql/rpl_parallel.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/rpl_parallel.h b/sql/rpl_parallel.h
index 0b9619e5e83..0e88e09652b 100644
--- a/sql/rpl_parallel.h
+++ b/sql/rpl_parallel.h
@@ -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.