[MDEV-31355] innodb_undo_log_truncate=ON fails to wait for purge of enough transaction history Created: 2023-05-26 Updated: 2023-06-23 Resolved: 2023-06-08 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11, 11.0, 11.1 |
| Fix Version/s: | 10.5.22, 10.6.15, 10.9.8, 10.10.6, 10.11.5, 11.0.3, 11.1.2 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Marko Mäkelä | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | corruption, crash, purge, rr-profile-analyzed | ||
| Issue Links: |
|
||||||||||||||||||||
| Description |
|
mleich produced an rr replay trace leading to a failure that demonstrates that the condition that was introduced in
In the trace that we got, we have rseg.needs_purge=0x27f5 and head.trx_no=0x2805 but purge_sys.view.m_up_limit_id=0x27f3. The thread that will crash holds a read view that is similar to the purge_sys.view. The function row_vers_build_for_consistent_read() will invoke trx_undo_prev_version_build() 3 times until it crashes: first on the newest version DB_TRX_ID=0x2844, then on DB_TRX_ID=0x2800, and finally crashing on DB_TRX_ID=0x27f4 while trying to access an undo page 0x2e that was invalidated by the undo tablespace truncation. This time, the failure looks like this:
It seems to me that the check here as well as in trx_purge_truncate_rseg_history() will have to be revised to something like purge_sys.view.sees(rseg.needs_purge). |
| Comments |
| Comment by Marko Mäkelä [ 2023-06-01 ] | |
|
vlad.lesin, this will require some nontrivial adjustments to the test innodb.cursor-restore-locking that you created. I think that this needs to be reviewed by you. | |
| Comment by Marko Mäkelä [ 2023-06-07 ] | |
|
vlad.lesin, thank you for your help with the test. I revised the fix with that, and also with a change to the test innodb.dml_purge that would fix occasional failures in 10.6 of the following invocation:
| |
| Comment by Vladislav Lesin [ 2023-06-08 ] | |
|
LGTM |