Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
Description
InnoDB maintains an internal persistent sequence of transaction identifiers. This sequence is used for assigning both transaction start identifiers (DB_TRX_ID=trx->id) and end identifiers (trx->no) as well as end identifiers for the mysql.transaction_registry table that was introduced in MDEV-12894.
Every 256th update of the sequence would cause a write to the TRX_SYS page. We can completely avoid accessing the TRX_SYS page if we modify the InnoDB startup so that resurrecting the sequence from other pages of the transaction system.
It turns out that startup is not reading the undo log pages of of committed transactions. In order not to cause additional page accesses on startup, we must persist trx_sys.get_max_trx_id() in the rollback segment header pages. On startup, we will simply pick up the maximum value. This page format change will be identified by repurposing an existing field TRX_RSEG_MAX_SIZE and writing it as zero. This change has the convenient side effect that after a downgrade to an older version of MariaDB and MySQL, no transactions can be created.
On transaction commit, we will still write some binlog and Galera WSREP XID information to the TRX_SYS page. If these features are disabled, the TRX_SYS page will not be accessed at all outside server startup or undo log tablespace truncation.
Attachments
Issue Links
- blocks
-
MDEV-15104 Remove trx_sys_t::rw_trx_ids and trx_sys_t::serialisation_list
- Closed
-
MDEV-15158 On commit, do not write to the TRX_SYS page
- Closed
- causes
-
MDEV-15418 innodb_force_recovery=5 displays bogus warnings about too new transaction identifier
- Closed
-
MDEV-18952 CHECK TABLE should use READ UNCOMMITED if innodb_force_recovery>=5
- Closed
-
MDEV-27800 upgrade from MariaDB 10.2 to 10.5.13 results in [ERROR] InnoDB: corrupted TRX_NO
- Closed
- relates to
-
MDEV-15143 InnoDB: Rollback of trx with id 0 completed
- Closed
-
MDEV-11657 Cross-engine transaction metadata
- Open