MySQL 9.1.0
Source Code Documentation
Writeset_trx_dependency_tracker Class Reference

Generate logical timestamps for MTS using WRITESET binlog transaction dependency tracking algorithm. More...

#include <rpl_trx_tracking.h>

Public Member Functions

 Writeset_trx_dependency_tracker (ulong max_history_size)
 
void get_dependency (THD *thd, int64 &sequence_number, int64 &commit_parent)
 Main function that gets the dependencies using the WRITESET tracker. More...
 
void rotate (int64 start)
 

Public Attributes

std::atomic< ulong > m_opt_max_history_size
 

Private Types

using Writeset_history = ankerl::unordered_dense::map< uint64, int64 >
 

Private Attributes

int64 m_writeset_history_start
 
Writeset_history m_writeset_history
 

Detailed Description

Generate logical timestamps for MTS using WRITESET binlog transaction dependency tracking algorithm.

Tracks dependencies based on the set of rows updated. Any two transactions that change disjoint sets of rows, are said concurrent and non-contending.

Member Typedef Documentation

◆ Writeset_history

using Writeset_trx_dependency_tracker::Writeset_history = ankerl::unordered_dense::map<uint64, int64>
private

Constructor & Destructor Documentation

◆ Writeset_trx_dependency_tracker()

Writeset_trx_dependency_tracker::Writeset_trx_dependency_tracker ( ulong  max_history_size)
inline

Member Function Documentation

◆ get_dependency()

void Writeset_trx_dependency_tracker::get_dependency ( THD thd,
int64 sequence_number,
int64 commit_parent 
)

Main function that gets the dependencies using the WRITESET tracker.

Get the writeset dependencies of a transaction.

Parameters
[in]thdTHD of the caller.
[in,out]sequence_numbersequence_number initialized and returned.
[in,out]commit_parentcommit_parent to be returned.

This takes the commit_parent that must be previously set using Commit_order_trx_dependency_tracker and tries to make the commit_parent as low as possible, using the writesets of each transaction. The commit_parent returned depends on how many row hashes are stored in the writeset_history, which is cleared once it reaches the user-defined maximum.

Parameters
[in]thdCurrent THD from which to extract trx context.
[in,out]sequence_numberSequence number of current transaction.
[in,out]commit_parentCommit_parent of current transaction, pre-filled with the commit_parent calculated by Commit_order_trx_dependency_tracker to use when the writeset commit_parent is not valid.

◆ rotate()

void Writeset_trx_dependency_tracker::rotate ( int64  start)

Member Data Documentation

◆ m_opt_max_history_size

std::atomic<ulong> Writeset_trx_dependency_tracker::m_opt_max_history_size

◆ m_writeset_history

Writeset_history Writeset_trx_dependency_tracker::m_writeset_history
private

◆ m_writeset_history_start

int64 Writeset_trx_dependency_tracker::m_writeset_history_start
private

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