MySQL 9.0.0
Source Code Documentation
Commit_order_trx_dependency_tracker Class Reference

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
 

Detailed Description

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.

Member Function Documentation

◆ get_dependency()

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.

Parameters
[in]thdTHD of the caller.
[in]parallelization_barrierTransaction is blocking and subseqent transactions should depend on it.
[in,out]sequence_numbersequence_number initialized and returned.
[in,out]commit_parentcommit_parent to be returned.
[in]thdCurrent THD from which to extract trx context.
[in]parallelization_barrierThe transaction is a parallelization_barrier and subseqent transactions should depend on it.
[in,out]sequence_numberSequence number of current transaction.
[in,out]commit_parentCommit_parent of current transaction, pre-filled with the commit_parent calculated by the logical clock logic.

◆ get_max_committed_transaction()

Logical_clock Commit_order_trx_dependency_tracker::get_max_committed_transaction ( )
inline

◆ rotate()

void Commit_order_trx_dependency_tracker::rotate ( )

◆ step()

int64 Commit_order_trx_dependency_tracker::step ( )

◆ update_max_committed()

void Commit_order_trx_dependency_tracker::update_max_committed ( int64  sequence_number)

Member Data Documentation

◆ m_last_blocking_transaction

int64 Commit_order_trx_dependency_tracker::m_last_blocking_transaction = SEQ_UNINIT
private

◆ m_max_committed_transaction

Logical_clock Commit_order_trx_dependency_tracker::m_max_committed_transaction
private

◆ m_transaction_counter

Logical_clock Commit_order_trx_dependency_tracker::m_transaction_counter
private

The documentation for this class was generated from the following files: