diff options
author | Kristian Nielsen <knielsen@knielsen-hq.org> | 2015-05-11 11:55:58 +0200 |
---|---|---|
committer | Kristian Nielsen <knielsen@knielsen-hq.org> | 2015-05-11 12:43:38 +0200 |
commit | 8bedb638d7078c007b58bea4196c3749028192b4 (patch) | |
tree | 510740c7ce604ce5b96d88bf5b2a38b7d8550a6c /sql/rpl_parallel.cc | |
parent | ecfc3de57ee6a498b30ca8f59fdb952ab38f5698 (diff) | |
download | mariadb-git-8bedb638d7078c007b58bea4196c3749028192b4.tar.gz |
MDEV-8113: Parallel slave: slave hangs on ALTER TABLE (or other DDL) as the first event after slave start
In optimistic parallel replication, it is not safe to try to run a following
transaction in parallel with a DDL statement, and there is code to prevent
this.
However, the code was missing the case where the DDL is the very first event
after slave start. In this case, following transactions could run in
parallel with the DDL, which can cause the slave to hang or even corrupt
slave in unlucky cases.
Diffstat (limited to 'sql/rpl_parallel.cc')
-rw-r--r-- | sql/rpl_parallel.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/rpl_parallel.cc b/sql/rpl_parallel.cc index d046caf0540..9a1786cee5d 100644 --- a/sql/rpl_parallel.cc +++ b/sql/rpl_parallel.cc @@ -2299,6 +2299,11 @@ rpl_parallel::do_event(rpl_group_info *serial_rgi, Log_event *ev, } gco->flags= flags; } + else + { + if (gtid_flags & Gtid_log_event::FL_DDL) + force_switch_flag= group_commit_orderer::FORCE_SWITCH; + } rgi->speculation= speculation; if (gtid_flags & Gtid_log_event::FL_GROUP_COMMIT_ID) |