diff options
Diffstat (limited to 'sql/rpl_rli.h')
-rw-r--r-- | sql/rpl_rli.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/sql/rpl_rli.h b/sql/rpl_rli.h index 9885417aa3f..ddf6c2ccc71 100644 --- a/sql/rpl_rli.h +++ b/sql/rpl_rli.h @@ -621,6 +621,8 @@ struct rpl_group_info counting one event group twice. */ bool did_mark_start_commit; + /* Copy of flags2 from GTID event. */ + uchar gtid_ev_flags2; enum { GTID_DUPLICATE_NULL=0, GTID_DUPLICATE_IGNORE=1, @@ -652,6 +654,36 @@ struct rpl_group_info inuse_relaylog *relay_log; uint64 retry_start_offset; uint64 retry_event_count; + /* + If `speculation' is != SPECULATE_NO, then we are optimistically running + this transaction in parallel, even though it might not be safe (there may + be a conflict with a prior event group). + + In this case, a conflict can cause other errors than deadlocks (like + duplicate key for example). So in case of _any_ error, we need to roll + back and retry the event group. + */ + enum enum_speculation { + /* + This transaction was group-committed together on the master with the + other transactions with which it is replicated in parallel. + */ + SPECULATE_NO, + /* + We will optimistically try to run this transaction in parallel with + other transactions, even though it is not known to be conflict free. + If we get a conflict, we will detect it as a deadlock, roll back and + retry. + */ + SPECULATE_OPTIMISTIC, + /* + This transaction got a conflict during speculative parallel apply, or + it was marked on the master as likely to cause a conflict or unsafe to + speculate. So it will wait for the prior transaction to commit before + starting to replicate. + */ + SPECULATE_WAIT + } speculation; bool killed_for_retry; rpl_group_info(Relay_log_info *rli_); |