diff options
author | Nirbhay Choubey <nirbhay@mariadb.com> | 2015-08-08 14:21:22 -0400 |
---|---|---|
committer | Nirbhay Choubey <nirbhay@mariadb.com> | 2015-08-08 14:21:22 -0400 |
commit | 91acc8b16fdd8409765f32b5453851366552a709 (patch) | |
tree | 18c04064e9fc127c5e477ec08613aae7baaab2ae /sql/handler.cc | |
parent | 4c69dc8116950d6bf0b09bfbc31a86d89831a364 (diff) | |
parent | 0403790722e3941779ccea26e85fcd818e2320b5 (diff) | |
download | mariadb-git-91acc8b16fdd8409765f32b5453851366552a709.tar.gz |
Merge tag 'mariadb-10.0.21' into 10.0-galera
Diffstat (limited to 'sql/handler.cc')
-rw-r--r-- | sql/handler.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sql/handler.cc b/sql/handler.cc index 01d3eed8d08..70f1d977c41 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -1641,6 +1641,26 @@ int ha_rollback_trans(THD *thd, bool all) DBUG_ASSERT(thd->transaction.stmt.ha_list == NULL || trans == &thd->transaction.stmt); +#ifdef HAVE_REPLICATION + if (is_real_trans) + { + /* + In parallel replication, if we need to rollback during commit, we must + first inform following transactions that we are going to abort our commit + attempt. Otherwise those following transactions can run too early, and + possibly cause replication to fail. See comments in retry_event_group(). + + There were several bugs with this in the past that were very hard to + track down (MDEV-7458, MDEV-8302). So we add here an assertion for + rollback without signalling following transactions. And in release + builds, we explicitly do the signalling before rolling back. + */ + DBUG_ASSERT(!(thd->rgi_slave && thd->rgi_slave->did_mark_start_commit)); + if (thd->rgi_slave && thd->rgi_slave->did_mark_start_commit) + thd->rgi_slave->unmark_start_commit(); + } +#endif + if (thd->in_sub_stmt) { DBUG_ASSERT(0); |