![]() |
MySQL 9.0.0
Source Code Documentation
|
Generate logical timestamps for MTS using COMMIT_ORDER binlog transaction dependency tracking algorithm. More...
#include <rpl_trx_tracking.h>
Public Member Functions | |
void | get_dependency (THD *thd, bool parallelization_barrier, int64 &sequence_number, int64 &commit_parent) |
Main function that gets the dependencies using the COMMIT_ORDER tracker. More... | |
void | update_max_committed (int64 sequence_number) |
Logical_clock | get_max_committed_transaction () |
int64 | step () |
void | rotate () |
Private Attributes | |
Logical_clock | m_max_committed_transaction |
Logical_clock | m_transaction_counter |
int64 | m_last_blocking_transaction = SEQ_UNINIT |
Generate logical timestamps for MTS using COMMIT_ORDER binlog transaction dependency tracking algorithm.
Tracks dependencies based on the commit order of transactions. The time intervals during which any transaction holds all its locks are tracked (the interval ends just before storage engine commit, when locks are released. For an autocommit transaction it begins just before storage engine prepare. For BEGIN..COMMIT transactions it begins at the end of the last statement before COMMIT). Two transactions are marked as non-conflicting if their respective intervals overlap. In other words, if trx1 appears before trx2 in the binlog, and trx2 had acquired all its locks before trx1 released its locks, then trx2 is marked such that the replica can schedule it in parallel with trx1.
void Commit_order_trx_dependency_tracker::get_dependency | ( | THD * | thd, |
bool | parallelization_barrier, | ||
int64 & | sequence_number, | ||
int64 & | commit_parent | ||
) |
Main function that gets the dependencies using the COMMIT_ORDER tracker.
Get the sequence_number for a transaction, and get the last_commit based on parallel committing transactions.
[in] | thd | THD of the caller. |
[in] | parallelization_barrier | Transaction is blocking and subseqent transactions should depend on it. |
[in,out] | sequence_number | sequence_number initialized and returned. |
[in,out] | commit_parent | commit_parent to be returned. |
[in] | thd | Current THD from which to extract trx context. |
[in] | parallelization_barrier | The transaction is a parallelization_barrier and subseqent transactions should depend on it. |
[in,out] | sequence_number | Sequence number of current transaction. |
[in,out] | commit_parent | Commit_parent of current transaction, pre-filled with the commit_parent calculated by the logical clock logic. |
|
inline |
void Commit_order_trx_dependency_tracker::rotate | ( | ) |
int64 Commit_order_trx_dependency_tracker::step | ( | ) |
void Commit_order_trx_dependency_tracker::update_max_committed | ( | int64 | sequence_number | ) |
|
private |
|
private |
|
private |