summaryrefslogtreecommitdiff
path: root/sql/rpl_parallel.h
diff options
context:
space:
mode:
authorKristian Nielsen <knielsen@knielsen-hq.org>2014-07-02 12:51:45 +0200
committerKristian Nielsen <knielsen@knielsen-hq.org>2014-07-02 12:51:45 +0200
commit4cb1e0eea0c965df3e91c1637f17127c1e7d6db7 (patch)
treefcd765b61b9013483f27e9fee7b7624d94bc77e6 /sql/rpl_parallel.h
parentbd2117d154b9cc367b708932de5d6064a339462d (diff)
downloadmariadb-git-4cb1e0eea0c965df3e91c1637f17127c1e7d6db7.tar.gz
MDEV-6321: close_temporary_tables() in format description event not serialised correctly
When a master server starts up, it logs a special format_description event at the start of a new binlog to mark that is has restarted. This is used by a slave to drop all temporary tables - this is needed in case the master crashed and did not have a chance to send explicit DROP TEMPORARY TABLE statements to the slave. In parallel replication, we need to be careful when dropping the temporary tables - we need to be sure that no prior events are still executing that might be using the temporary tables to be dropped, _and_ that no following events have started executing that might have created new temporary tables that should not be dropped. This was not handled correctly, which could cause errors about access to not existing temporary tables or even crashes. This patch implements that such format_description events cause serialisation of event execution; all prior events are executed to completion first, then the format_description event is executed, dropping temporary tables, then following events are queued for execution. Master restarts should be sufficiently infrequent that the resulting loss of parallelism should be of minimal impact.
Diffstat (limited to 'sql/rpl_parallel.h')
-rw-r--r--sql/rpl_parallel.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/rpl_parallel.h b/sql/rpl_parallel.h
index c7e15528e97..d59205cc72a 100644
--- a/sql/rpl_parallel.h
+++ b/sql/rpl_parallel.h
@@ -239,6 +239,7 @@ struct rpl_parallel {
void wait_for_done(THD *thd, Relay_log_info *rli);
void stop_during_until();
bool workers_idle();
+ void wait_for_workers_idle(THD *thd);
int do_event(rpl_group_info *serial_rgi, Log_event *ev, ulonglong event_size);
};