mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge MDEV-8302 into 10.1
This commit is contained in:
@ -1615,6 +1615,24 @@ int ha_rollback_trans(THD *thd, bool all)
|
||||
DBUG_ASSERT(thd->transaction.stmt.ha_list == NULL ||
|
||||
trans == &thd->transaction.stmt);
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
if (thd->in_sub_stmt)
|
||||
{
|
||||
DBUG_ASSERT(0);
|
||||
|
Reference in New Issue
Block a user