diff options
author | Kristian Nielsen <knielsen@knielsen-hq.org> | 2014-08-19 14:26:42 +0200 |
---|---|---|
committer | Kristian Nielsen <knielsen@knielsen-hq.org> | 2014-08-19 14:26:42 +0200 |
commit | 453c29c3f772d7bec69be2a2bf5a5747444f0a77 (patch) | |
tree | 2c05e85227ab49bffb2bbf8f2cf621b12a09bed7 /sql/rpl_parallel.h | |
parent | 4cb1e0eea0c965df3e91c1637f17127c1e7d6db7 (diff) | |
download | mariadb-git-453c29c3f772d7bec69be2a2bf5a5747444f0a77.tar.gz |
MDEV-6321: close_temporary_tables() in format description event not serialised correctly
Follow-up patch, fixing a possible deadlock issue.
If the master crashes in the middle of an event group, there can be an active
transaction in a worker thread when we encounter the following master restart
format description event. In this case, we need to notify that worker thread
to abort and roll back the partial event group. Otherwise a deadlock occurs:
the worker thread waits for the commit that never arrives, and the SQL driver
thread waits for the worker thread to complete its event group, which it never
does.
Diffstat (limited to 'sql/rpl_parallel.h')
-rw-r--r-- | sql/rpl_parallel.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sql/rpl_parallel.h b/sql/rpl_parallel.h index d59205cc72a..befe08b3d9b 100644 --- a/sql/rpl_parallel.h +++ b/sql/rpl_parallel.h @@ -76,10 +76,15 @@ struct rpl_parallel_thread { queued_event can hold either an event to be executed, or just a binlog position to be updated without any associated event. */ - enum queued_event_t { QUEUED_EVENT, QUEUED_POS_UPDATE } typ; + enum queued_event_t { + QUEUED_EVENT, + QUEUED_POS_UPDATE, + QUEUED_MASTER_RESTART + } typ; union { Log_event *ev; /* QUEUED_EVENT */ - rpl_parallel_entry *entry_for_queued; /* QUEUED_POS_UPDATE */ + rpl_parallel_entry *entry_for_queued; /* QUEUED_POS_UPDATE and + QUEUED_MASTER_RESTART */ }; rpl_group_info *rgi; inuse_relaylog *ir; @@ -224,8 +229,8 @@ struct rpl_parallel_entry { rpl_parallel_thread * choose_thread(rpl_group_info *rgi, bool *did_enter_cond, PSI_stage_info *old_stage, bool reuse); - group_commit_orderer *get_gco(); - void free_gco(group_commit_orderer *gco); + int queue_master_restart(rpl_group_info *rgi, + Format_description_log_event *fdev); }; struct rpl_parallel { HASH domain_hash; |