summaryrefslogtreecommitdiff
path: root/sql/rpl_parallel.h
diff options
context:
space:
mode:
authorKristian Nielsen <knielsen@knielsen-hq.org>2015-05-26 12:47:35 +0200
committerKristian Nielsen <knielsen@knielsen-hq.org>2015-05-26 13:04:15 +0200
commite5f1e841dc32ccb8e8630876e8073efd778d3efd (patch)
treed56611270886a591627a8c59ce7747f14a2a6679 /sql/rpl_parallel.h
parentef99edf1a87d5234cf0dd8d496f0adfbf4040dad (diff)
downloadmariadb-git-e5f1e841dc32ccb8e8630876e8073efd778d3efd.tar.gz
MDEV-8147: Assertion `m_lock_type == 2' failed in handler::ha_close() during parallel replication
When the slave processes the master restart format_description event, parallel replication needs to complete any prior events before processing the restart event (which closes temporary tables and such stuff). This happens in wait_for_workers_idle(), however it was not waiting long enough. The wait was using wait_for_prior_commit(), but at that points table can still be open. This lead to assertion in this case. So change wait_for_workers_idle() to wait until all worker threads have reached finish_event_group(), at which point all tables should have been closed.
Diffstat (limited to 'sql/rpl_parallel.h')
-rw-r--r--sql/rpl_parallel.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/rpl_parallel.h b/sql/rpl_parallel.h
index 09e0f39c0cd..0c2e4270646 100644
--- a/sql/rpl_parallel.h
+++ b/sql/rpl_parallel.h
@@ -228,6 +228,12 @@ struct rpl_parallel_entry {
*/
bool force_abort;
/*
+ Set in wait_for_workers_idle() to show that it is waiting, so that
+ finish_event_group knows to signal it when last_committed_sub_id is
+ increased.
+ */
+ bool need_sub_id_signal;
+ /*
At STOP SLAVE (force_abort=true), we do not want to process all events in
the queue (which could unnecessarily delay stop, if a lot of events happen
to be queued). The stop_count provides a safe point at which to stop, so