MySQL 8.4.2
Source Code Documentation
|
The transaction system central memory data structure. More...
#include <trx0sys.h>
Public Member Functions | |
Trx_shard & | get_shard_by_trx_id (trx_id_t trx_id) |
template<typename F > | |
auto | latch_and_execute_with_active_trx (trx_id_t trx_id, F &&f, const ut::Location &loc) |
Public Attributes | |
char | pad0 [ut::INNODB_CACHE_LINE_SIZE] |
char | pad1 [ut::INNODB_CACHE_LINE_SIZE] |
char | pad2 [ut::INNODB_CACHE_LINE_SIZE] |
char | pad4 [ut::INNODB_CACHE_LINE_SIZE] |
char | pad_after [ut::INNODB_CACHE_LINE_SIZE] |
MVCC * | mvcc |
Multi version concurrency control manager. 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... | |
std::atomic< uint64_t > | rseg_history_len |
Length of the TRX_RSEG_HISTORY list (update undo logs for committed transactions). More... | |
std::atomic< trx_id_t > | next_trx_id_or_no |
The smallest number not yet assigned as a transaction id or transaction number. More... | |
TrxSysMutex | serialisation_mutex |
Mutex to protect serialisation_list. More... | |
trx_id_t | rw_max_trx_no |
Max trx number of read-write transactions added for purge. More... | |
char | pad3 [ut::INNODB_CACHE_LINE_SIZE] |
std::atomic< trx_id_t > | serialisation_min_trx_no |
UT_LIST_BASE_NODE_T (trx_t, no_list) serialisation_list | |
Tracks minimal transaction id which has received trx->no, but has not yet finished commit for the mtr writing the trx commit. More... | |
TrxSysMutex | mutex |
Mutex protecting most fields in this structure (the default one). More... | |
char | pad5 [ut::INNODB_CACHE_LINE_SIZE] |
char | pad6 [ut::INNODB_CACHE_LINE_SIZE] |
trx_ids_t | rw_trx_ids |
Array of Read write transaction IDs for MVCC snapshot. More... | |
char | pad7 [ut::INNODB_CACHE_LINE_SIZE] |
Trx_shard | shards [TRX_SHARDS_N] |
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... | |
UT_LIST_BASE_NODE_T (trx_t, trx_list) rw_trx_list | |
List of active and committed in memory read-write transactions, sorted on trx id, biggest first. More... | |
UT_LIST_BASE_NODE_T (trx_t, mysql_trx_list) mysql_trx_list | |
List of transactions created for MySQL. More... | |
The transaction system central memory data structure.
|
inline |
trx_sys_t::UT_LIST_BASE_NODE_T | ( | trx_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. Additionally, mysql_trx_list may contain transactions that have not yet been started in InnoDB.
trx_sys_t::UT_LIST_BASE_NODE_T | ( | trx_t | , |
no_list | |||
) |
Tracks minimal transaction id which has received trx->no, but has not yet finished commit for the mtr writing the trx commit.
Protected by the serialisation_mutex. Ordered on the trx->no field.
trx_sys_t::UT_LIST_BASE_NODE_T | ( | trx_t | , |
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.
bool trx_sys_t::found_prepared_trx |
True if XA PREPARED trxs are found.
TrxSysMutex trx_sys_t::mutex |
Mutex protecting most fields in this structure (the default one).
MVCC* trx_sys_t::mvcc |
Multi version concurrency control manager.
ulint trx_sys_t::n_prepared_trx |
Number of transactions currently in the XA PREPARED state.
std::atomic<trx_id_t> trx_sys_t::next_trx_id_or_no |
The smallest number not yet assigned as a transaction id or transaction number.
This is declared as atomic because it can be accessed without holding any mutex during AC-NL-RO view creation. When it is used for assignment of the trx->id, it is synchronized by the trx_sys_t::mutex. When it is used for assignment of the trx->no, it is synchronized by the trx_sys_t::serialisation_mutex. Note: it might be in parallel used for both trx->id and trx->no assignments (for different trx_t objects).
char trx_sys_t::pad0[ut::INNODB_CACHE_LINE_SIZE] |
char trx_sys_t::pad1[ut::INNODB_CACHE_LINE_SIZE] |
char trx_sys_t::pad2[ut::INNODB_CACHE_LINE_SIZE] |
char trx_sys_t::pad3[ut::INNODB_CACHE_LINE_SIZE] |
char trx_sys_t::pad4[ut::INNODB_CACHE_LINE_SIZE] |
char trx_sys_t::pad5[ut::INNODB_CACHE_LINE_SIZE] |
char trx_sys_t::pad6[ut::INNODB_CACHE_LINE_SIZE] |
char trx_sys_t::pad7[ut::INNODB_CACHE_LINE_SIZE] |
char trx_sys_t::pad_after[ut::INNODB_CACHE_LINE_SIZE] |
std::atomic<uint64_t> trx_sys_t::rseg_history_len |
Length of the TRX_RSEG_HISTORY list (update undo logs for committed transactions).
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.
trx_id_t trx_sys_t::rw_max_trx_no |
Max trx number of read-write transactions added for purge.
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.
std::atomic<trx_id_t> trx_sys_t::serialisation_min_trx_no |
TrxSysMutex trx_sys_t::serialisation_mutex |
Mutex to protect serialisation_list.
Trx_shard trx_sys_t::shards[TRX_SHARDS_N] |
Mapping from transaction id to transaction instance.
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.