summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorKristian Nielsen <knielsen@knielsen-hq.org>2015-08-04 12:39:22 +0200
committerKristian Nielsen <knielsen@knielsen-hq.org>2015-08-04 12:39:22 +0200
commitdbd205797b7ee4373972d9d2014bf24e5a01b094 (patch)
tree847d2c6742d61a4d27517f6516a70d11b19707ba /sql/handler.cc
parent35a019837e0290af45962484b4ddc1d6a92ac654 (diff)
parent9b9c5e890c16176eaf6b54d466708c54e2df7c9d (diff)
downloadmariadb-git-dbd205797b7ee4373972d9d2014bf24e5a01b094.tar.gz
Merge MDEV-8302 into 10.1
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index 70f30580a07..4f070d3336b 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -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);