#include "univ.i"
#include "trx0types.h"
#include "fsp0types.h"
#include "fil0fil.h"
#include "buf0buf.h"
#include "mtr0mtr.h"
#include "ut0byte.h"
#include "mem0mem.h"
#include "sync0sync.h"
#include "ut0lst.h"
#include "read0types.h"
#include "page0types.h"
#include <drizzled/atomics.h>
#include "fsp0fsp.h"
Go to the source code of this file.
Classes | |
struct | trx_doublewrite_struct |
struct | trx_sys_struct |
Macros | |
#define | trx0sys_h |
#define | TRX_SYS_SYSTEM_RSEG_ID 0 |
#define | TRX_SYS_SPACE 0 /* the SYSTEM tablespace */ |
#define | TRX_SYS_PAGE_NO FSP_TRX_SYS_PAGE_NO |
#define | TRX_SYS FSEG_PAGE_DATA |
#define | TRX_SYS_TRX_ID_STORE 0 |
#define | TRX_SYS_FSEG_HEADER 8 |
#define | TRX_SYS_RSEGS (8 + FSEG_HEADER_SIZE) |
#define | TRX_SYS_N_RSEGS 128 |
#define | TRX_SYS_OLD_N_RSEGS 256 |
#define | TRX_SYS_MYSQL_LOG_NAME_LEN 512 |
#define | TRX_SYS_MYSQL_LOG_MAGIC_N 873422344 |
#define | TRX_SYS_MYSQL_MASTER_LOG_INFO (UNIV_PAGE_SIZE - 2000) |
#define | TRX_SYS_DRIZZLE_LOG_INFO (UNIV_PAGE_SIZE - 1000) |
#define | TRX_SYS_DRIZZLE_MAX_COMMIT_ID 8 |
#define | TRX_SYS_DRIZZLE_LOG_NAME 12 |
#define | TRX_SYS_TRX_ID_WRITE_MARGIN 256 |
#define | TRX_SYS_DOUBLEWRITE (UNIV_PAGE_SIZE - 200) |
#define | TRX_SYS_DOUBLEWRITE_FSEG 0 |
#define | TRX_SYS_DOUBLEWRITE_MAGIC FSEG_HEADER_SIZE |
#define | TRX_SYS_DOUBLEWRITE_BLOCK1 (4 + FSEG_HEADER_SIZE) |
#define | TRX_SYS_DOUBLEWRITE_BLOCK2 (8 + FSEG_HEADER_SIZE) |
#define | TRX_SYS_DOUBLEWRITE_REPEAT 12 |
#define | TRX_SYS_DOUBLEWRITE_SPACE_ID_STORED (24 + FSEG_HEADER_SIZE) |
#define | TRX_SYS_DOUBLEWRITE_MAGIC_N 536853855 |
#define | TRX_SYS_DOUBLEWRITE_SPACE_ID_STORED_N 1783657386 |
#define | TRX_SYS_DOUBLEWRITE_BLOCK_SIZE FSP_EXTENT_SIZE |
#define | TRX_SYS_FILE_FORMAT_TAG (UNIV_PAGE_SIZE - 16) |
#define | TRX_SYS_FILE_FORMAT_TAG_MAGIC_N_LOW 3645922177UL |
#define | TRX_SYS_FILE_FORMAT_TAG_MAGIC_N_HIGH 2745987765UL |
#define | TRX_SYS_FILE_FORMAT_TAG_MAGIC_N |
Functions | |
UNIV_INTERN void | trx_sys_create_doublewrite_buf (void) |
UNIV_INTERN void | trx_sys_doublewrite_init_or_restore_pages (ibool restore_corrupt_pages) |
UNIV_INTERN void | trx_sys_mark_upgraded_to_multiple_tablespaces (void) |
UNIV_INTERN ibool | trx_doublewrite_page_inside (ulint page_no) |
UNIV_INLINE ibool | trx_sys_hdr_page (ulint space, ulint page_no) |
UNIV_INTERN void | trx_sys_init_at_db_start (void) |
UNIV_INTERN void | trx_sys_create (void) |
UNIV_INTERN ulint | trx_sysf_rseg_find_free (mtr_t *mtr) |
UNIV_INLINE trx_rseg_t * | trx_sys_get_nth_rseg (trx_sys_t *sys, ulint n) |
UNIV_INLINE void | trx_sys_set_nth_rseg (trx_sys_t *sys, ulint n, trx_rseg_t *rseg) |
UNIV_INLINE trx_sysf_t * | trx_sysf_get (mtr_t *mtr) |
UNIV_INLINE ulint | trx_sysf_rseg_get_space (trx_sysf_t *sys_header, ulint i, mtr_t *mtr) |
UNIV_INLINE ulint | trx_sysf_rseg_get_page_no (trx_sysf_t *sys_header, ulint i, mtr_t *mtr) |
UNIV_INLINE void | trx_sysf_rseg_set_space (trx_sysf_t *sys_header, ulint i, ulint space, mtr_t *mtr) |
UNIV_INLINE void | trx_sysf_rseg_set_page_no (trx_sysf_t *sys_header, ulint i, ulint page_no, mtr_t *mtr) |
UNIV_INLINE trx_id_t | trx_sys_get_new_trx_id (void) |
UNIV_INLINE trx_id_t | trx_sys_get_new_trx_no (void) |
UNIV_INLINE void | trx_write_trx_id (byte *ptr, trx_id_t id) |
UNIV_INLINE trx_id_t | trx_read_trx_id (const byte *ptr) |
UNIV_INLINE trx_t * | trx_get_on_id (trx_id_t trx_id) |
UNIV_INLINE trx_id_t | trx_list_get_min_trx_id (void) |
UNIV_INLINE ibool | trx_is_active (trx_id_t trx_id) |
UNIV_INTERN ibool | trx_in_trx_list (trx_t *in_trx) |
UNIV_INTERN void | trx_sys_flush_commit_id (uint64_t commit_id, ulint field, mtr_t *mtr) |
UNIV_INTERN void | trx_sys_read_commit_id (void) |
UNIV_INTERN void | trx_sys_print_mysql_master_log_pos (void) |
UNIV_INTERN void | trx_sys_file_format_init (void) |
UNIV_INTERN void | trx_sys_file_format_close (void) |
UNIV_INTERN void | trx_sys_file_format_tag_init (void) |
UNIV_INTERN void | trx_sys_close (void) |
UNIV_INTERN const char * | trx_sys_file_format_id_to_name (const ulint id) |
UNIV_INTERN ibool | trx_sys_file_format_max_set (ulint format_id, const char **name) |
UNIV_INTERN const char * | trx_sys_file_format_max_get (void) |
UNIV_INTERN ulint | trx_sys_file_format_max_check (ulint max_format_id) |
UNIV_INTERN ibool | trx_sys_file_format_max_upgrade (const char **name, ulint format_id) |
UNIV_INTERN void | trx_sys_create_rsegs (ulint n_rsegs) |
Variables | |
drizzled::atomic< uint64_t > | trx_sys_commit_id |
trx_sys_t * | trx_sys |
trx_doublewrite_t * | trx_doublewrite |
ibool | trx_doublewrite_must_reset_space_ids |
ibool | trx_doublewrite_buf_is_being_created |
ibool | trx_sys_multiple_tablespace_format |
#define TRX_SYS_DOUBLEWRITE (UNIV_PAGE_SIZE - 200) |
Doublewrite buffer The offset of the doublewrite buffer header on the trx system header page
Definition at line 471 of file trx0sys.h.
Referenced by trx_sys_create_doublewrite_buf(), trx_sys_doublewrite_init_or_restore_pages(), and trx_sys_mark_upgraded_to_multiple_tablespaces().
#define TRX_SYS_DOUBLEWRITE_BLOCK1 (4 + FSEG_HEADER_SIZE) |
page number of the first page in the first sequence of 64 (= FSP_EXTENT_SIZE) consecutive pages in the doublewrite buffer
Definition at line 481 of file trx0sys.h.
Referenced by trx_sys_create_doublewrite_buf().
#define TRX_SYS_DOUBLEWRITE_BLOCK2 (8 + FSEG_HEADER_SIZE) |
page number of the first page in the second sequence of 64 consecutive pages in the doublewrite buffer
Definition at line 488 of file trx0sys.h.
Referenced by trx_sys_create_doublewrite_buf().
#define TRX_SYS_DOUBLEWRITE_BLOCK_SIZE FSP_EXTENT_SIZE |
Size of the doublewrite block in pages
Definition at line 516 of file trx0sys.h.
Referenced by buf_read_page_low(), trx_doublewrite_page_inside(), trx_sys_create_doublewrite_buf(), and trx_sys_doublewrite_init_or_restore_pages().
#define TRX_SYS_DOUBLEWRITE_FSEG 0 |
fseg header of the fseg containing the doublewrite buffer
Definition at line 473 of file trx0sys.h.
Referenced by trx_sys_create_doublewrite_buf().
#define TRX_SYS_DOUBLEWRITE_MAGIC FSEG_HEADER_SIZE |
4-byte magic number which shows if we already have created the doublewrite buffer
Definition at line 476 of file trx0sys.h.
Referenced by trx_sys_create_doublewrite_buf(), and trx_sys_doublewrite_init_or_restore_pages().
#define TRX_SYS_DOUBLEWRITE_MAGIC_N 536853855 |
Contents of TRX_SYS_DOUBLEWRITE_MAGIC
Definition at line 511 of file trx0sys.h.
Referenced by trx_sys_create_doublewrite_buf(), and trx_sys_doublewrite_init_or_restore_pages().
#define TRX_SYS_DOUBLEWRITE_REPEAT 12 |
we repeat TRX_SYS_DOUBLEWRITE_MAGIC, TRX_SYS_DOUBLEWRITE_BLOCK1, TRX_SYS_DOUBLEWRITE_BLOCK2 so that if the trx sys header is half-written to disk, we still may be able to recover the information
Definition at line 494 of file trx0sys.h.
Referenced by trx_sys_create_doublewrite_buf().
#define TRX_SYS_DOUBLEWRITE_SPACE_ID_STORED (24 + FSEG_HEADER_SIZE) |
If this is not yet set to TRX_SYS_DOUBLEWRITE_SPACE_ID_STORED_N,
we must reset the doublewrite buffer, because starting from 4.1.x the space id of a data page is stored into FIL_PAGE_ARCH_LOG_NO_OR_SPACE_NO.
Definition at line 507 of file trx0sys.h.
Referenced by trx_sys_create_doublewrite_buf(), trx_sys_doublewrite_init_or_restore_pages(), and trx_sys_mark_upgraded_to_multiple_tablespaces().
#define TRX_SYS_DOUBLEWRITE_SPACE_ID_STORED_N 1783657386 |
Contents of TRX_SYS_DOUBLEWRITE_SPACE_ID_STORED
Definition at line 513 of file trx0sys.h.
Referenced by trx_sys_create_doublewrite_buf(), trx_sys_doublewrite_init_or_restore_pages(), and trx_sys_mark_upgraded_to_multiple_tablespaces().
#define TRX_SYS_DRIZZLE_LOG_INFO (UNIV_PAGE_SIZE - 1000) |
The offset of the MySQL binlog offset info in the trx system header
Definition at line 463 of file trx0sys.h.
Referenced by trx_commit_off_kernel(), and trx_sys_read_commit_id().
#define TRX_SYS_DRIZZLE_MAX_COMMIT_ID 8 |
the maximum commit id assigned in the system
Definition at line 464 of file trx0sys.h.
Referenced by trx_sys_flush_commit_id(), and trx_sys_read_commit_id().
#define TRX_SYS_FILE_FORMAT_TAG (UNIV_PAGE_SIZE - 16) |
#define TRX_SYS_FILE_FORMAT_TAG_MAGIC_N |
Contents of TRX_SYS_FILE_FORMAT_TAG when valid. The file format
identifier is added to this 64-bit constant.
#define TRX_SYS_FILE_FORMAT_TAG_MAGIC_N_HIGH 2745987765UL |
#define TRX_SYS_FILE_FORMAT_TAG_MAGIC_N_LOW 3645922177UL |
#define TRX_SYS_FSEG_HEADER 8 |
#define TRX_SYS_MYSQL_LOG_MAGIC_N 873422344 |
#define TRX_SYS_MYSQL_LOG_NAME_LEN 512 |
#define TRX_SYS_MYSQL_MASTER_LOG_INFO (UNIV_PAGE_SIZE - 2000) |
#define TRX_SYS_RSEGS (8 + FSEG_HEADER_SIZE) |
#define TRX_SYS_TRX_ID_STORE 0 |
Transaction system header the maximum trx id or trx number modulo TRX_SYS_TRX_ID_UPDATE_MARGIN written to a file page by any transaction; the assignment of transaction ids continues from this number rounded up by TRX_SYS_TRX_ID_UPDATE_MARGIN plus TRX_SYS_TRX_ID_UPDATE_MARGIN when the database is started
Definition at line 419 of file trx0sys.h.
Referenced by trx_sys_init_at_db_start().
#define TRX_SYS_TRX_ID_WRITE_MARGIN 256 |
When a trx id which is zero modulo this number (which must be a power of
two) is assigned, the field TRX_SYS_TRX_ID_STORE on the transaction system page is updated
Definition at line 593 of file trx0sys.h.
Referenced by trx_sys_init_at_db_start().
UNIV_INTERN ibool trx_doublewrite_page_inside | ( | ulint | page_no | ) |
Determines if a page number is located inside the doublewrite buffer.
Determines if a page number is located inside the doublewrite buffer.
page_no | in: page number |
Definition at line 153 of file trx0sys.cc.
References trx_doublewrite_struct::block1, trx_doublewrite_struct::block2, trx_doublewrite, trx_doublewrite_page_inside(), and TRX_SYS_DOUBLEWRITE_BLOCK_SIZE.
Referenced by buf_page_io_complete(), and trx_doublewrite_page_inside().
Looks for the trx handle with the given id in trx_list.
Referenced by row_vers_build_for_semi_consistent_read(), row_vers_impl_x_locked_off_kernel(), and trx_lists_init_at_db_start().
UNIV_INTERN ibool trx_in_trx_list | ( | trx_t * | in_trx | ) |
Checks that trx is in the trx list.
Checks that trx is in the trx list.
in_trx | in: trx |
Definition at line 638 of file trx0sys.cc.
References trx_in_trx_list(), trx_sys, ut_ad, UT_LIST_GET_FIRST, and UT_LIST_GET_NEXT.
Referenced by trx_in_trx_list().
UNIV_INLINE ibool trx_is_active | ( | trx_id_t | trx_id | ) |
Checks if a transaction with the given id is active.
Referenced by row_vers_impl_x_locked_off_kernel().
UNIV_INLINE trx_id_t trx_list_get_min_trx_id | ( | void | ) |
Returns the minumum trx id in trx list. This is the smallest id for which the trx can possibly be active. (But, you must look at the trx->conc_state to find out if the minimum trx id transaction itself is active, or already committed.)
Referenced by lock_sec_rec_read_check_and_lock().
UNIV_INLINE trx_id_t trx_read_trx_id | ( | const byte * | ptr | ) |
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_...
Referenced by row_unlock_for_mysql().
UNIV_INTERN void trx_sys_close | ( | void | ) |
Shutdown/Close the transaction system.
Definition at line 1417 of file trx0sys.cc.
References trx_doublewrite_struct::buf_block_arr, mem_free, trx_doublewrite_struct::mutex, sess_close(), trx_doublewrite, trx_dummy_sess, trx_purge_sys_close(), trx_rseg_mem_free(), trx_sys, trx_sys_close(), ut_a, ut_ad, ut_free(), UT_LIST_GET_FIRST, UT_LIST_GET_LEN, UT_LIST_GET_NEXT, UT_LIST_REMOVE, and trx_doublewrite_struct::write_buf_unaligned.
Referenced by innobase_shutdown_for_mysql(), and trx_sys_close().
UNIV_INTERN void trx_sys_create | ( | void | ) |
Creates and initializes the transaction system at the database creation.
Definition at line 908 of file trx0sys.cc.
References mtr_commit(), mtr_start(), trx_sys_create(), and trx_sys_init_at_db_start().
Referenced by innobase_start_or_create_for_mysql(), and trx_sys_create().
UNIV_INTERN void trx_sys_create_doublewrite_buf | ( | void | ) |
Creates the doublewrite buffer to a new InnoDB installation. The header of the doublewrite buffer is placed on the trx system header page.
Definition at line 252 of file trx0sys.cc.
References buf_page_get, buf_pool_get_curr_size(), FIL_NULL, log_make_checkpoint_at(), mach_read_from_4(), MLOG_4BYTES, mlog_write_ulint(), mtr_commit(), mtr_start(), trx_doublewrite, trx_doublewrite_buf_is_being_created, trx_sys_create_doublewrite_buf(), TRX_SYS_DOUBLEWRITE, TRX_SYS_DOUBLEWRITE_BLOCK1, TRX_SYS_DOUBLEWRITE_BLOCK2, TRX_SYS_DOUBLEWRITE_BLOCK_SIZE, TRX_SYS_DOUBLEWRITE_FSEG, TRX_SYS_DOUBLEWRITE_MAGIC, TRX_SYS_DOUBLEWRITE_MAGIC_N, TRX_SYS_DOUBLEWRITE_REPEAT, TRX_SYS_DOUBLEWRITE_SPACE_ID_STORED, TRX_SYS_DOUBLEWRITE_SPACE_ID_STORED_N, trx_sys_multiple_tablespace_format, and ut_a.
Referenced by innobase_start_or_create_for_mysql(), and trx_sys_create_doublewrite_buf().
UNIV_INTERN void trx_sys_create_rsegs | ( | ulint | n_rsegs | ) |
number of rollback segments to create
n_rsegs | number of rollback segments to create |
Definition at line 1182 of file trx0sys.cc.
References recv_needed_recovery, and trx_sys_create_rsegs().
Referenced by innobase_start_or_create_for_mysql(), and trx_sys_create_rsegs().
UNIV_INTERN void trx_sys_doublewrite_init_or_restore_pages | ( | ibool | restore_corrupt_pages | ) |
At a database startup initializes the doublewrite buffer memory structure if we already have a doublewrite buffer created in the data files. If we are upgrading to an InnoDB version which supports multiple tablespaces, then this function performs the necessary update operations. If we are in a crash recovery, this function uses a possible doublewrite buffer to restore half-written pages in the data files. in: TRUE=restore pages
At a database startup initializes the doublewrite buffer memory structure if we already have a doublewrite buffer created in the data files. If we are upgrading to an InnoDB version which supports multiple tablespaces, then this function performs the necessary update operations. If we are in a crash recovery, this function uses a possible doublewrite buffer to restore half-written pages in the data files.
restore_corrupt_pages | in: TRUE=restore pages |
Definition at line 430 of file trx0sys.cc.
References trx_doublewrite_struct::block1, trx_doublewrite_struct::block2, FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID, FIL_PAGE_OFFSET, FIL_TABLESPACE, mach_read_from_4(), mach_write_to_4(), OS_FILE_READ, trx_doublewrite, trx_doublewrite_must_reset_space_ids, TRX_SYS_DOUBLEWRITE, TRX_SYS_DOUBLEWRITE_BLOCK_SIZE, trx_sys_doublewrite_init_or_restore_pages(), TRX_SYS_DOUBLEWRITE_MAGIC, TRX_SYS_DOUBLEWRITE_MAGIC_N, TRX_SYS_DOUBLEWRITE_SPACE_ID_STORED, TRX_SYS_DOUBLEWRITE_SPACE_ID_STORED_N, trx_sys_multiple_tablespace_format, ut_align(), ut_free(), ut_malloc(), and trx_doublewrite_struct::write_buf.
Referenced by recv_recovery_from_checkpoint_start_func(), and trx_sys_doublewrite_init_or_restore_pages().
UNIV_INTERN void trx_sys_file_format_close | ( | void | ) |
Closes the tablespace tag system.
Definition at line 1172 of file trx0sys.cc.
References trx_sys_file_format_close().
Referenced by innobase_shutdown_for_mysql(), and trx_sys_file_format_close().
UNIV_INTERN const char* trx_sys_file_format_id_to_name | ( | const ulint | id | ) |
Get the name representation of the file format from its id.
Get the name representation of the file format from its id.
id | in: id of the file format |
Definition at line 1001 of file trx0sys.cc.
References trx_sys_file_format_id_to_name(), and ut_a.
Referenced by innobase_file_format_name_lookup(), innobase_init(), innodb_file_format_max_validate(), innodb_file_format_name_validate(), trx_sys_file_format_id_to_name(), trx_sys_file_format_init(), and trx_sys_file_format_max_check().
UNIV_INTERN void trx_sys_file_format_init | ( | void | ) |
Initializes the tablespace tag system.
Definition at line 1154 of file trx0sys.cc.
References DICT_TF_FORMAT_MIN, file_format_struct::id, file_format_struct::mutex, file_format_struct::name, trx_sys_file_format_id_to_name(), and trx_sys_file_format_init().
Referenced by innobase_start_or_create_for_mysql(), and trx_sys_file_format_init().
UNIV_INTERN ulint trx_sys_file_format_max_check | ( | ulint | max_format_id | ) |
Check for the max file format tag stored on disk.
Check for the max file format tag stored on disk. Note: If max_format_id is == DICT_TF_FORMAT_MAX + 1 then we only print a warning.
max_format_id | in: max format id to check |
Definition at line 1016 of file trx0sys.cc.
References DICT_TF_FORMAT_MAX, DICT_TF_FORMAT_MIN, file_format_struct::id, file_format_struct::name, trx_sys_file_format_id_to_name(), trx_sys_file_format_max_check(), and ut_a.
Referenced by innobase_start_or_create_for_mysql(), and trx_sys_file_format_max_check().
UNIV_INTERN const char* trx_sys_file_format_max_get | ( | void | ) |
Get the name representation of the file format from its id.
Definition at line 1144 of file trx0sys.cc.
References file_format_struct::name, and trx_sys_file_format_max_get().
Referenced by innobase_init(), and trx_sys_file_format_max_get().
UNIV_INTERN ibool trx_sys_file_format_max_set | ( | ulint | format_id, |
const char ** | name | ||
) |
Set the file format id unconditionally except if it's already the same value.
Set the file format id unconditionally except if it's already the same value.
format_id | in: file format id |
name | out: max file format name or NULL if not needed. |
Definition at line 1067 of file trx0sys.cc.
References DICT_TF_FORMAT_MAX, file_format_struct::id, file_format_struct::mutex, trx_sys_file_format_max_set(), and ut_a.
Referenced by innodb_file_format_max_validate(), trx_sys_file_format_max_set(), and trx_sys_file_format_tag_init().
UNIV_INTERN ibool trx_sys_file_format_max_upgrade | ( | const char ** | name, |
ulint | format_id | ||
) |
Update the file format tag in the system tablespace only if the given format id is greater than the known max id.
Update the file format tag in the system tablespace only if the given format id is greater than the known max id.
name | out: max file format name |
format_id | in: file format identifier |
Definition at line 1116 of file trx0sys.cc.
References DICT_TF_FORMAT_MAX, file_format_struct::id, file_format_struct::mutex, file_format_struct::name, trx_sys_file_format_max_upgrade(), and ut_a.
Referenced by InnobaseEngine::doCreateTable(), ha_innobase::doOpen(), and trx_sys_file_format_max_upgrade().
UNIV_INTERN void trx_sys_file_format_tag_init | ( | void | ) |
Tags the system table space with minimum format id if it has not been tagged yet. WARNING: This function is only called during the startup and AFTER the redo log application during recovery has finished.
Definition at line 1097 of file trx0sys.cc.
References DICT_TF_FORMAT_MIN, trx_sys_file_format_max_set(), and trx_sys_file_format_tag_init().
Referenced by innobase_start_or_create_for_mysql(), and trx_sys_file_format_tag_init().
UNIV_INTERN void trx_sys_flush_commit_id | ( | uint64_t | commit_id, |
ulint | field, | ||
mtr_t * | mtr | ||
) |
Writes to the sys header file the latest commit_id in the system
Definition at line 684 of file trx0sys.cc.
References mlog_write_ull(), TRX_SYS_DRIZZLE_MAX_COMMIT_ID, trx_sys_flush_commit_id(), and trx_sysf_get().
Referenced by trx_commit_off_kernel(), and trx_sys_flush_commit_id().
UNIV_INLINE trx_id_t trx_sys_get_new_trx_id | ( | void | ) |
UNIV_INLINE trx_id_t trx_sys_get_new_trx_no | ( | void | ) |
Allocates a new transaction number.
Referenced by trx_commit_off_kernel().
UNIV_INLINE trx_rseg_t* trx_sys_get_nth_rseg | ( | trx_sys_t * | sys, |
ulint | n | ||
) |
Gets the pointer in the nth slot of the rseg array.
sys | in: trx system |
Referenced by trx_start_low().
UNIV_INLINE ibool trx_sys_hdr_page | ( | ulint | space, |
ulint | page_no | ||
) |
Checks if a page address is the trx sys header page.
space | in: space |
Referenced by buf_read_ahead_linear(), and buf_read_page_low().
UNIV_INTERN void trx_sys_init_at_db_start | ( | void | ) |
Creates and initializes the central memory structures for the transaction system. This is called when the database is started.
Definition at line 824 of file trx0sys.cc.
References trx_struct::conc_state, trx_sys_struct::latest_rseg, mach_read_from_8(), trx_sys_struct::max_trx_id, mtr_commit(), mtr_start(), sess_open(), trx_dummy_sess, TRX_ID_FMT, trx_lists_init_at_db_start(), trx_purge_sys_create(), trx_rseg_list_and_array_init(), trx_sys, trx_sys_init_at_db_start(), TRX_SYS_TRX_ID_STORE, TRX_SYS_TRX_ID_WRITE_MARGIN, trx_sysf_get(), trx_struct::undo_no, ut_ad, UT_LIST_GET_FIRST, UT_LIST_GET_LEN, UT_LIST_GET_NEXT, UT_LIST_INIT, and ut_uint64_align_up().
Referenced by innobase_start_or_create_for_mysql(), trx_sys_create(), and trx_sys_init_at_db_start().
UNIV_INTERN void trx_sys_mark_upgraded_to_multiple_tablespaces | ( | void | ) |
Marks the trx sys header when we have successfully upgraded to the >= 4.1.x multiple tablespace format.
Definition at line 217 of file trx0sys.cc.
References buf_page_get, log_make_checkpoint_at(), MLOG_4BYTES, mlog_write_ulint(), mtr_commit(), mtr_start(), TRX_SYS_DOUBLEWRITE, TRX_SYS_DOUBLEWRITE_SPACE_ID_STORED, TRX_SYS_DOUBLEWRITE_SPACE_ID_STORED_N, trx_sys_mark_upgraded_to_multiple_tablespaces(), and trx_sys_multiple_tablespace_format.
Referenced by innobase_start_or_create_for_mysql(), and trx_sys_mark_upgraded_to_multiple_tablespaces().
UNIV_INTERN void trx_sys_print_mysql_master_log_pos | ( | void | ) |
Prints to stderr the MySQL master log offset info in the trx system header if the magic number shows it valid.
UNIV_INTERN void trx_sys_read_commit_id | ( | void | ) |
Reads the latest commit_id into trx_sys_commit_id
Definition at line 697 of file trx0sys.cc.
References mach_read_from_8(), mtr_commit(), mtr_start(), trx_sys_commit_id, TRX_SYS_DRIZZLE_LOG_INFO, TRX_SYS_DRIZZLE_MAX_COMMIT_ID, trx_sys_read_commit_id(), and trx_sysf_get().
Referenced by trx_sys_read_commit_id().
UNIV_INLINE void trx_sys_set_nth_rseg | ( | trx_sys_t * | sys, |
ulint | n, | ||
trx_rseg_t * | rseg | ||
) |
Sets the pointer in the nth slot of the rseg array. in: pointer to rseg object, NULL if slot not in use
sys | in: trx system |
n | in: index of slot |
Referenced by trx_rseg_mem_free().
UNIV_INLINE trx_sysf_t* trx_sysf_get | ( | mtr_t * | mtr | ) |
Gets a pointer to the transaction system file copy and x-locks its page.
Referenced by trx_rseg_header_create(), trx_sys_flush_commit_id(), trx_sys_init_at_db_start(), trx_sys_read_commit_id(), and trx_sysf_rseg_find_free().
UNIV_INTERN ulint trx_sysf_rseg_find_free | ( | mtr_t * | mtr | ) |
Looks for a free slot for a rollback segment in the trx system file copy.
Looks for a free slot for a rollback segment in the trx system file copy.
mtr | in: mtr |
Definition at line 718 of file trx0sys.cc.
References FIL_NULL, trx_sysf_get(), trx_sysf_rseg_find_free(), trx_sysf_rseg_get_page_no(), and ut_ad.
Referenced by trx_sysf_rseg_find_free().
UNIV_INLINE ulint trx_sysf_rseg_get_page_no | ( | trx_sysf_t * | sys_header, |
ulint | i, | ||
mtr_t * | mtr | ||
) |
Gets the page number of the nth rollback segment slot in the trx system file copy.
sys_header | in: trx sys file copy |
i | in: slot index == rseg id |
Referenced by trx_sysf_rseg_find_free().
UNIV_INLINE ulint trx_sysf_rseg_get_space | ( | trx_sysf_t * | sys_header, |
ulint | i, | ||
mtr_t * | mtr | ||
) |
Gets the space of the nth rollback segment slot in the trx system file copy.
sys_header | in: trx sys file copy |
i | in: slot index == rseg id |
UNIV_INLINE void trx_sysf_rseg_set_page_no | ( | trx_sysf_t * | sys_header, |
ulint | i, | ||
ulint | page_no, | ||
mtr_t * | mtr | ||
) |
Sets the page number of the nth rollback segment slot in the trx system file copy. in: mtr
sys_header | in: trx sys file copy |
i | in: slot index == rseg id |
page_no | in: page number, FIL_NULL if the slot is reset to unused |
Referenced by trx_rseg_header_create().
UNIV_INLINE void trx_sysf_rseg_set_space | ( | trx_sysf_t * | sys_header, |
ulint | i, | ||
ulint | space, | ||
mtr_t * | mtr | ||
) |
Sets the space id of the nth rollback segment slot in the trx system file copy. in: mtr
sys_header | in: trx sys file copy |
i | in: slot index == rseg id |
space | in: space id |
Referenced by trx_rseg_header_create().
UNIV_INLINE void trx_write_trx_id | ( | byte * | ptr, |
trx_id_t | id | ||
) |
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_... in: id
ptr | in: pointer to memory where written |
Referenced by row_ins_step(), row_upd_index_entry_sys_field(), row_upd_rec_sys_fields_in_recovery(), and trx_undo_update_rec_get_update().
trx_doublewrite_t* trx_doublewrite |
Doublewrite system
The doublewrite buffer
Definition at line 63 of file trx0sys.cc.
Referenced by buf_read_page_low(), innobase_start_or_create_for_mysql(), trx_doublewrite_page_inside(), trx_sys_close(), trx_sys_create_doublewrite_buf(), and trx_sys_doublewrite_init_or_restore_pages().
ibool trx_doublewrite_buf_is_being_created |
Set to TRUE when the doublewrite buffer is being created
Definition at line 69 of file trx0sys.cc.
Referenced by trx_sys_create_doublewrite_buf().
ibool trx_doublewrite_must_reset_space_ids |
The following is set to TRUE when we are upgrading from pre-4.1
format data files to the multiple tablespaces format data files
Definition at line 67 of file trx0sys.cc.
Referenced by innobase_start_or_create_for_mysql(), and trx_sys_doublewrite_init_or_restore_pages().
trx_sys_t* trx_sys |
The transaction system
Definition at line 61 of file trx0sys.cc.
Referenced by lock_check_trx_id_sanity(), lock_print_info_all_transactions(), lock_print_info_summary(), lock_release_off_kernel(), logs_empty_and_mark_files_at_shutdown(), read_cursor_view_create_for_mysql(), read_view_close(), read_view_oldest_copy_or_open_new(), read_view_open_now(), srv_printf_innodb_monitor(), srv_purge_thread(), trx_allocate_for_mysql(), trx_cleanup_at_db_startup(), trx_commit_off_kernel(), trx_free_for_mysql(), trx_get_trx_by_xid(), trx_in_trx_list(), trx_lists_init_at_db_start(), trx_purge(), trx_purge_add_update_undo_to_history(), trx_recover_for_mysql(), trx_rollback_or_clean_recovered(), trx_rseg_get_on_id(), trx_rseg_list_and_array_init(), trx_rseg_mem_free(), trx_start_low(), trx_sys_close(), and trx_sys_init_at_db_start().
drizzled::atomic<uint64_t> trx_sys_commit_id |
the highest commit identifier assigned in the system
Definition at line 96 of file trx0sys.cc.
Referenced by trx_commit_off_kernel(), and trx_sys_read_commit_id().
ibool trx_sys_multiple_tablespace_format |
The following is TRUE when we are using the database in the
post-4.1 format, i.e., we have successfully upgraded, or have created a new database installation
Definition at line 74 of file trx0sys.cc.
Referenced by ibuf_insert(), trx_sys_create_doublewrite_buf(), trx_sys_doublewrite_init_or_restore_pages(), and trx_sys_mark_upgraded_to_multiple_tablespaces().