MySQL  8.0.12
Source Code Documentation
trx_sys_t Struct Reference

The transaction system central memory data structure. More...

#include <trx0sys.h>

Public Attributes

TrxSysMutex mutex
 mutex protecting most fields in this structure except when noted otherwise More...
 
MVCCmvcc
 Multi version concurrency control manager. More...
 
volatile trx_id_t max_trx_id
 The smallest number not yet assigned as a transaction id or transaction number. More...
 
std::atomic< trx_id_tmin_active_id
 Minimal transaction id which is still in active state. More...
 
trx_ut_list_t serialisation_list
 Ordered on trx_t::no of all the currenrtly active RW transactions. More...
 
trx_id_t rw_max_trx_id
 Max trx id of read-write transactions which exist or existed. More...
 
char pad1 [64]
 To avoid false sharing. More...
 
trx_ut_list_t rw_trx_list
 List of active and committed in memory read-write transactions, sorted on trx id, biggest first. More...
 
char pad2 [64]
 To avoid false sharing. More...
 
trx_ut_list_t mysql_trx_list
 List of transactions created for MySQL. More...
 
trx_ids_t rw_trx_ids
 Array of Read write transaction IDs for MVCC snapshot. More...
 
char pad3 [64]
 To avoid false sharing. More...
 
Rsegs rsegs
 Vector of pointers to rollback segments. More...
 
Rsegs tmp_rsegs
 Vector of pointers to rollback segments within the temp tablespace; This vector is created and destroyed in single-threaded mode so it is not protected by any mutex because it is read-only during multi-threaded operation. More...
 
ulint rseg_history_len
 Length of the TRX_RSEG_HISTORY list (update undo logs for committed transactions), protected by rseg->mutex. More...
 
TrxIdSet rw_trx_set
 Mapping from transaction id to transaction instance. More...
 
ulint n_prepared_trx
 Number of transactions currently in the XA PREPARED state. More...
 
bool found_prepared_trx
 True if XA PREPARED trxs are found. More...
 

Detailed Description

The transaction system central memory data structure.

Member Data Documentation

◆ found_prepared_trx

bool trx_sys_t::found_prepared_trx

True if XA PREPARED trxs are found.

◆ max_trx_id

volatile trx_id_t trx_sys_t::max_trx_id

The smallest number not yet assigned as a transaction id or transaction number.

This is declared volatile because it can be accessed without holding any mutex during AC-NL-RO view creation.

◆ min_active_id

std::atomic<trx_id_t> trx_sys_t::min_active_id

Minimal transaction id which is still in active state.

◆ mutex

TrxSysMutex trx_sys_t::mutex

mutex protecting most fields in this structure except when noted otherwise

◆ mvcc

MVCC* trx_sys_t::mvcc

Multi version concurrency control manager.

◆ mysql_trx_list

trx_ut_list_t trx_sys_t::mysql_trx_list

List of transactions created for MySQL.

All user transactions are on mysql_trx_list. The rw_trx_list can contain system transactions and recovered transactions that will not be in the mysql_trx_list. mysql_trx_list may additionally contain transactions that have not yet been started in InnoDB.

◆ n_prepared_trx

ulint trx_sys_t::n_prepared_trx

Number of transactions currently in the XA PREPARED state.

◆ pad1

char trx_sys_t::pad1[64]

To avoid false sharing.

◆ pad2

char trx_sys_t::pad2[64]

To avoid false sharing.

◆ pad3

char trx_sys_t::pad3[64]

To avoid false sharing.

◆ rseg_history_len

ulint trx_sys_t::rseg_history_len

Length of the TRX_RSEG_HISTORY list (update undo logs for committed transactions), protected by rseg->mutex.

◆ rsegs

Rsegs trx_sys_t::rsegs

Vector of pointers to rollback segments.

These rsegs are iterated and added to the end under a read lock. They are deleted under a write lock while the vector is adjusted. They are created and destroyed in single-threaded mode.

◆ rw_max_trx_id

trx_id_t trx_sys_t::rw_max_trx_id

Max trx id of read-write transactions which exist or existed.

◆ rw_trx_ids

trx_ids_t trx_sys_t::rw_trx_ids

Array of Read write transaction IDs for MVCC snapshot.

A ReadView would take a snapshot of these transactions whose changes are not visible to it. We should remove transactions from the list before committing in memory and releasing locks to ensure right order of removal and consistent snapshot.

◆ rw_trx_list

trx_ut_list_t trx_sys_t::rw_trx_list

List of active and committed in memory read-write transactions, sorted on trx id, biggest first.

Recovered transactions are always on this list.

◆ rw_trx_set

TrxIdSet trx_sys_t::rw_trx_set

Mapping from transaction id to transaction instance.

◆ serialisation_list

trx_ut_list_t trx_sys_t::serialisation_list

Ordered on trx_t::no of all the currenrtly active RW transactions.

◆ tmp_rsegs

Rsegs trx_sys_t::tmp_rsegs

Vector of pointers to rollback segments within the temp tablespace; This vector is created and destroyed in single-threaded mode so it is not protected by any mutex because it is read-only during multi-threaded operation.


The documentation for this struct was generated from the following file: