Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.3.1-2
Description
The InnoDB clustered index record system columns DB_TRX_ID,DB_ROLL_PTR are used by multi-versioning and for determining if a record is implicitly locked. After the history is no longer needed, these columns can safely be reset to 0 and 1<<55 (to indicate a fresh insert).
When a reader sees 0 in the DB_TRX_ID column, it can instantly determine that the record is present the read view. There is no need to acquire the transaction system mutex to check if the transaction exists, because writes can never be conducted by a transaction whose ID is 0.
The persistent InnoDB undo log is split into two parts: insert_undo and update_undo. The insert_undo log is discarded at transaction commit or rollback, and the update_undo log is processed by the purge subsystem. As part of this change, we must merge the two types of undo logs into one, and the purge subsystem will reset the DB_TRX_ID whenever a clustered index record is ‘touched’.
Upgrade considerations
This will change the persistent InnoDB file formats, not only in the undo log and redo log, but also in the data files. There are some debug assertions that would not allow any record to contain DB_TRX_ID=0.
A new redo log format tag must be introduced so that the writes of the system columns can be properly redo-logged. (See MDEV-11432, MDEV-11782.) This will prevent a startup of an older version with the new-version redo logs. We may also prevent a crash recovery of MariaDB 10.2 files with the newer version. (Crash recovery of files from 10.1 or earlier versions is already prevented in 10.2.)
The undo log format will be changed as well. To be able to get rid of legacy code, InnoDB startup should detect if any old-format undo logs are present. If yes, startup will be refused, and the user must perform a slow shutdown (SET GLOBAL innodb_fast_shutdown=0) with the old server in order to empty the undo logs.
A proof-of-concept implementation for 10.2 consists of 4 consecutive commits. It is missing any of the above-mentioned upgrade logic.
Attachments
Issue Links
- blocks
-
MDEV-13697 DB_TRX_ID is not always reset when the history is removed
- Closed
- causes
-
MDEV-13475 InnoDB: Failing assertion: lsn == log_sys->lsn || srv_force_recovery == SRV_FORCE_NO_LOG_REDO
- Closed
-
MDEV-13476 TRX_UNDO_PAGE_TYPE mismatch when writing undo log after upgrade
- Closed
-
MDEV-13495 Crash in rollback of a recovered INSERT transaction after upgrade
- Closed
-
MDEV-13536 DB_TRX_ID is not actually being reset when the history is removed
- Closed
-
MDEV-13654 Various crashes due to DB_TRX_ID mismatch in table-rebuilding ALTER TABLE…LOCK=NONE
- Closed
-
MDEV-13820 trx_id_check() fails during row_log_table_apply()
- Closed
-
MDEV-15370 Upgrade fails when both insert_undo and update_undo exist for recovered transactions
- Closed
-
MDEV-15912 InnoDB: Failing assertion: purge_sys.tail.commit <= purge_sys.rseg->last_commit upon upgrade from 10.0 or 10.1 to 10.3
- Closed
-
MDEV-16017 galera mtr tests fail with sst_xtrabackup-v2
- Closed
-
MDEV-16273 innodb.alter_kill fails in buildbot with Unknown storage engine 'InnoDB'
- Closed
-
MDEV-18966 Transaction recovery may be broken after upgrade to 10.3
- Closed
-
MDEV-21158 trx_undo_seg_free() is never redo-logged
- Closed
- relates to
-
MDEV-13542 Crashing on a corrupted page is unhelpful
- Closed
-
MDEV-14848 MariaDB 10.3 refuses InnoDB crash-upgrade from MariaDB 10.2
- Closed
-
MDEV-17745 innodb.innodb_stats_persistent failed in buildbot with wrong result
- Closed
-
MDEV-20804 Use the sequence engine in main.index_merge_innodb and main.index_merge_myisam
- Closed
-
MDEV-26475 InnoDB must not lock delete-marked records
- Open
-
MDEV-27437 Galera snapshot transfer fails to upgrade between some major versions
- Closed
-
MDEV-515 innodb bulk insert
- Closed
-
MDEV-8139 Fix scrubbing
- Closed
-
MDEV-11432 Change the informational redo log format tag to say "MariaDB 10.2.3"
- Closed
-
MDEV-11658 Simpler, faster IMPORT of InnoDB tables
- Open
-
MDEV-11782 Redefine the innodb_encrypt_log format
- Closed
-
MDEV-12258 InnoDB: Fix the bogus debug assertion introduced in MDEV-12219
- Closed
-
MDEV-13269 Upgrade tests for InnoDB undo log
- Closed
-
MDEV-15522 Change galera suite MTR tests to use mariabackup instead of xtrabackup
- Closed
-
MDEV-16168 Performance regression on sysbench write benchmarks from 10.2 to 10.3
- Closed
-
MDEV-17044 mysql_upgrade is causing crash of mysqld
- Closed
-
MDEV-23017 range query performance regression in 10.5.4
- Closed
-
MDEV-24153 innodb assertion - trx_undo_t *trx_undo_mem_create_at_db_start(trx_rseg_t *, ulint, ulint, mtr_t *): Assertion `type == 2' faile
- Closed
-
MDEV-33067 SCN(Sequence Commit Number) based MVCC
- Open
- mentioned in
-
Page Loading...