[MDEV-13697] DB_TRX_ID is not always reset when the history is removed Created: 2017-09-01 Updated: 2021-07-12 Resolved: 2018-04-16 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.3.1 |
| Fix Version/s: | 10.3.7 |
| Type: | Bug | Priority: | Major |
| Reporter: | Marko Mäkelä | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | performance | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||
| Sprint: | 10.3.6-1 | ||||||||||||||||||||||||||||||||||||
| Description |
|
When an InnoDB transaction is about to update a record, two steps will be performed before the modification of the clustered index tree can start:
This bug is about the undo log processing. We can get to that phase only if the record was last modified by a committed transaction. In the scenario of this bug, that committed transaction would still exist in the system in the purge queue, and the record would still carry a nonzero DB_TRX_ID:
If the old transaction is purgeable, then we should write DB_TRX_ID=0 to the undo log record, so that in case our transaction is rolled back, the history will be reset at rollback.
In this report, there used to be a different test demonstrating a bug that affects all InnoDB versions since MySQL 3.23.49: |
| Comments |
| Comment by Marko Mäkelä [ 2018-03-16 ] |
|
In freshly inserted clustered index leaf page records, InnoDB should write DB_ROLL_PTR=0x80000000000000, because there never is a need to dereference the DB_ROLL_PTR. (Rollback should look up index records based on undo log records.) |