MySQL 8.0.39
Source Code Documentation
|
Transaction system. More...
#include "data0type.h"
#include "srv0srv.h"
#include "trx0trx.h"
#include "mtr0log.h"
#include "my_dbug.h"
Typedefs | |
typedef byte | trx_sysf_rseg_t |
Functions | |
void | trx_sys_write_max_trx_id (void) |
Writes the value of max_trx_id to the file based trx system header. More... | |
static bool | trx_sys_hdr_page (const page_id_t &page_id) |
Checks if a page address is the trx sys header page. More... | |
static trx_sysf_t * | trx_sysf_get (mtr_t *mtr) |
Gets a pointer to the transaction system header and x-latches its page. More... | |
static space_id_t | trx_sysf_rseg_get_space (trx_sysf_t *sys_header, ulint slot, mtr_t *mtr) |
Gets the space of the nth rollback segment slot in the trx system file copy. More... | |
static page_no_t | trx_sysf_rseg_get_page_no (trx_sysf_t *sys_header, ulint slot, mtr_t *mtr) |
Gets the page number of the nth rollback segment slot in the trx system header. More... | |
static void | trx_sysf_rseg_set_space (trx_sysf_t *sys_header, ulint slot, space_id_t space, mtr_t *mtr) |
Sets the space id of the nth rollback segment slot in the trx system file copy. More... | |
static void | trx_sysf_rseg_set_page_no (trx_sysf_t *sys_header, ulint slot, page_no_t page_no, mtr_t *mtr) |
Sets the page number of the nth rollback segment slot in the trx system header. More... | |
static void | trx_write_trx_id (byte *ptr, trx_id_t id) |
Writes a trx id to an index page. More... | |
static trx_id_t | trx_read_trx_id (const byte *ptr) |
Reads a trx id from an index page. More... | |
static trx_t * | trx_rw_is_active (trx_id_t trx_id, bool do_ref_count) |
trx_id_t | trx_sys_get_trx_id_write_margin () |
trx_id_t | trx_sys_allocate_trx_id_or_no () |
Allocates a new transaction id or transaction number. More... | |
trx_id_t | trx_sys_allocate_trx_id () |
Allocates a new transaction id (for trx->id). More... | |
trx_id_t | trx_sys_allocate_trx_no () |
Allocates a new transaction number (for trx->no). More... | |
static trx_id_t | trx_get_serialisation_min_trx_no (void) |
Reads trx->no up to which all transactions have been serialised. More... | |
trx_id_t | trx_sys_get_next_trx_id_or_no () |
Retrieves a next value that will be allocated if trx_sys_allocate_trx_id() or trx_sys_allocate_trx_id_trx_no() was called. More... | |
static bool | trx_sys_need_rollback () |
Determine if there are incomplete transactions in the system. More... | |
static void | trx_sys_rw_trx_add (trx_t *trx) |
Variables | |
constexpr uint32_t | TRX_SYS_RSEG_SPACE = 0 |
space where the segment header is placed; starting with MySQL/InnoDB 5.1.7, this is UNIV_UNDEFINED if the slot is unused More... | |
constexpr uint32_t | TRX_SYS_RSEG_PAGE_NO = 4 |
page number where the segment header is placed; this is FIL_NULL if the slot is unused More... | |
constexpr uint32_t | TRX_SYS_RSEG_SLOT_SIZE = 8 |
Transaction system.
Created 3/26/1996 Heikki Tuuri
typedef byte trx_sysf_rseg_t |
|
inlinestatic |
Reads trx->no up to which all transactions have been serialised.
Reads a trx id from an index page.
In case that the id size changes in some future version, this function should be used instead of mach_read_...
ptr | in: pointer to memory from where to read |
|
inline |
Allocates a new transaction id (for trx->id).
Before calling, the trx_sys_mutex must be acquired.
|
inline |
Allocates a new transaction id or transaction number.
|
inline |
Allocates a new transaction number (for trx->no).
Before calling, the trx_sys_serialisation_mutex must be acquired.
|
inline |
Retrieves a next value that will be allocated if trx_sys_allocate_trx_id() or trx_sys_allocate_trx_id_trx_no() was called.
|
inline |
|
inlinestatic |
Checks if a page address is the trx sys header page.
[in] | page_id | page id |
|
inlinestatic |
Determine if there are incomplete transactions in the system.
|
inlinestatic |
void trx_sys_write_max_trx_id | ( | void | ) |
Writes the value of max_trx_id to the file based trx system header.
|
inlinestatic |
Gets a pointer to the transaction system header and x-latches its page.
mtr | in: mtr |
|
inlinestatic |
Gets the page number of the nth rollback segment slot in the trx system header.
sys_header | in: trx system header |
slot | in: slot index == rseg id |
mtr | in: mtr |
|
inlinestatic |
Gets the space of the nth rollback segment slot in the trx system file copy.
sys_header | in: trx sys header |
slot | in: slot index == rseg id |
mtr | in: mtr |
|
inlinestatic |
Sets the page number of the nth rollback segment slot in the trx system header.
sys_header | in: trx sys header |
slot | in: slot index == rseg id |
page_no | in: page number, FIL_NULL if the slot is reset to unused |
mtr | in: mtr |
|
inlinestatic |
Sets the space id of the nth rollback segment slot in the trx system file copy.
sys_header | in: trx sys file copy |
slot | in: slot index == rseg id |
space | in: space id |
mtr | in: mtr |
Writes a trx id to an index page.
In case that the id size changes in some future version, this function should be used instead of mach_write_...
ptr | in: pointer to memory where written |
id | in: id |
|
constexpr |
page number where the segment header is placed; this is FIL_NULL if the slot is unused
|
constexpr |
|
constexpr |
space where the segment header is placed; starting with MySQL/InnoDB 5.1.7, this is UNIV_UNDEFINED if the slot is unused