summaryrefslogtreecommitdiff
path: root/sql/rpl_parallel.h
diff options
context:
space:
mode:
authorKristian Nielsen <knielsen@knielsen-hq.org>2015-03-24 16:33:51 +0100
committerKristian Nielsen <knielsen@knielsen-hq.org>2015-03-24 16:33:51 +0100
commitbd2ae787ea273169dc88db62bc1e66d56cbe9a4c (patch)
treedd3110dc6cb77255ace329e433de7d8abeca2a8d /sql/rpl_parallel.h
parentec68494beb151bc01ff6885476d2d4aeab3fe345 (diff)
downloadmariadb-git-bd2ae787ea273169dc88db62bc1e66d56cbe9a4c.tar.gz
MDEV-7825: Parallel replication race condition on gco->flags, possibly resulting in slave hang
The patch for optimistic parallel replication as a memory optimisation moved the gco->installed field into a bit in gco->flags. However, that is just plain wrong. The gco->flags field is owned by the SQL driver thread, but gco->installed is used by the worker threads, so this will cause a race condition. The user-visible problem might be conflicts between transactions and/or slave threads hanging. So revert this part of the optimistic parallel replication patch, going back to using a separate field gco->installed like in 10.0.
Diffstat (limited to 'sql/rpl_parallel.h')
-rw-r--r--sql/rpl_parallel.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/sql/rpl_parallel.h b/sql/rpl_parallel.h
index eebb8d136a9..93139971ca6 100644
--- a/sql/rpl_parallel.h
+++ b/sql/rpl_parallel.h
@@ -66,7 +66,8 @@ struct group_commit_orderer {
This flag is set when this GCO has been installed into the next_gco pointer
of the previous GCO.
*/
- static const uint8 INSTALLED = 0x01;
+ bool installed;
+
/*
This flag is set for a GCO in which we have event groups with multiple
different commit_id values from the master. This happens when we
@@ -77,13 +78,13 @@ struct group_commit_orderer {
of current commit_id, as DDL is not safe to speculatively apply in parallel
with prior event groups.
*/
- static const uint8 MULTI_BATCH = 0x02;
+ static const uint8 MULTI_BATCH = 0x01;
/*
This flag is set for a GCO that contains DDL. If set, it forces a switch to
a new GCO upon seeing a new commit_id, as DDL is not safe to speculatively
replicate in parallel with subsequent transactions.
*/
- static const uint8 FORCE_SWITCH = 0x04;
+ static const uint8 FORCE_SWITCH = 0x02;
uint8 flags;
};