diff options
Diffstat (limited to 'sql/rpl_rli.h')
-rw-r--r-- | sql/rpl_rli.h | 43 |
1 files changed, 39 insertions, 4 deletions
diff --git a/sql/rpl_rli.h b/sql/rpl_rli.h index e3f8e10a705..74d5b6fe416 100644 --- a/sql/rpl_rli.h +++ b/sql/rpl_rli.h @@ -402,7 +402,7 @@ public: void close_temporary_tables(); /* Check if UNTIL condition is satisfied. See slave.cc for more. */ - bool is_until_satisfied(THD *thd, Log_event *ev); + bool is_until_satisfied(my_off_t); inline ulonglong until_pos() { DBUG_ASSERT(until_condition == UNTIL_MASTER_POS || @@ -531,8 +531,6 @@ struct inuse_relaylog { /* Set when all events have been read from a relaylog. */ bool completed; char name[FN_REFLEN]; - /* Lock used to protect inuse_relaylog::dequeued_count */ - my_atomic_rwlock_t inuse_relaylog_atomic_lock; }; @@ -652,6 +650,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, @@ -690,7 +690,42 @@ struct rpl_group_info inuse_relaylog *relay_log; uint64 retry_start_offset; uint64 retry_event_count; - bool killed_for_retry; + /* + 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; + enum enum_retry_killed { + RETRY_KILL_NONE = 0, + RETRY_KILL_PENDING, + RETRY_KILL_KILLED + }; + uchar killed_for_retry; rpl_group_info(Relay_log_info *rli_); ~rpl_group_info(); |