diff options
author | Kristian Nielsen <knielsen@knielsen-hq.org> | 2014-12-05 16:09:48 +0100 |
---|---|---|
committer | Kristian Nielsen <knielsen@knielsen-hq.org> | 2014-12-06 08:49:50 +0100 |
commit | db21fddc3740dfa48f3443751c48282467afac5e (patch) | |
tree | 3ed31a4a5ce9abf3fe98cdd9c9bdf68ba8b5832b /sql/handler.h | |
parent | 1e3f09f1638e2bdec6029f6c98317d17d7ca76d1 (diff) | |
download | mariadb-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/handler.h')
-rw-r--r-- | sql/handler.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sql/handler.h b/sql/handler.h index 00445565f06..b669f58ecee 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -1422,7 +1422,11 @@ struct THD_TRANS */ bool modified_non_trans_table; - void reset() { no_2pc= FALSE; modified_non_trans_table= FALSE; } + void reset() { + no_2pc= FALSE; + modified_non_trans_table= FALSE; + m_unsafe_rollback_flags= 0; + } bool is_empty() const { return ha_list == NULL; } THD_TRANS() {} /* Remove gcc warning */ @@ -1434,12 +1438,17 @@ struct THD_TRANS static unsigned int const MODIFIED_NON_TRANS_TABLE= 0x01; static unsigned int const CREATED_TEMP_TABLE= 0x02; static unsigned int const DROPPED_TEMP_TABLE= 0x04; + static unsigned int const DID_WAIT= 0x08; void mark_created_temp_table() { DBUG_PRINT("debug", ("mark_created_temp_table")); m_unsafe_rollback_flags|= CREATED_TEMP_TABLE; } + void mark_trans_did_wait() { m_unsafe_rollback_flags|= DID_WAIT; } + bool trans_did_wait() const { + return (m_unsafe_rollback_flags & DID_WAIT) != 0; + } }; |