summaryrefslogtreecommitdiff
path: root/sql/rpl_parallel.h
diff options
context:
space:
mode:
authorKristian Nielsen <knielsen@knielsen-hq.org>2014-12-05 16:09:48 +0100
committerKristian Nielsen <knielsen@knielsen-hq.org>2014-12-06 08:49:50 +0100
commitdb21fddc3740dfa48f3443751c48282467afac5e (patch)
tree3ed31a4a5ce9abf3fe98cdd9c9bdf68ba8b5832b /sql/rpl_parallel.h
parent1e3f09f1638e2bdec6029f6c98317d17d7ca76d1 (diff)
downloadmariadb-git-db21fddc3740dfa48f3443751c48282467afac5e.tar.gz
MDEV-6676: Optimistic parallel replication
Implement a new mode for parallel replication. In this mode, all transactions are optimistically attempted applied in parallel. In case of conflicts, the offending transaction is rolled back and retried later non-parallel. This is an early-release patch to facilitate testing, more changes to user interface / options will be expected. The new mode is not enabled by default.
Diffstat (limited to 'sql/rpl_parallel.h')
-rw-r--r--sql/rpl_parallel.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/sql/rpl_parallel.h b/sql/rpl_parallel.h
index 239818855b8..2062c89e62e 100644
--- a/sql/rpl_parallel.h
+++ b/sql/rpl_parallel.h
@@ -49,7 +49,29 @@ struct group_commit_orderer {
uint64 wait_count;
group_commit_orderer *prev_gco;
group_commit_orderer *next_gco;
- bool installed;
+ /*
+ This flag is set when this GCO has been installed into the next_gco pointer
+ of the previous GCO.
+ */
+ static const uint8 INSTALLED = 0x01;
+ /*
+ 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
+ optimistically try to execute in parallel transactions not known to be
+ conflict-free.
+
+ When this flag is set, in case of DDL we need to start a new GCO regardless
+ of current commit_id, as DDL is not safe to speculatively apply in parallel
+ with prior event groups.
+ */
+ static const uint8 MULTI_BATCH = 0x02;
+ /*
+ 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;
+ uint8 flags;
};