[MDEV-27817] InnoDB recovery of recently created files is not crash-safe Created: 2022-02-11 Updated: 2022-02-22 Resolved: 2022-02-13 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.6.6, 10.7.2, 10.8.1, 10.6.7, 10.7.3, 10.8.2 |
| Fix Version/s: | 10.6.8, 10.7.4, 10.8.3 |
| Type: | Bug | Priority: | Blocker |
| Reporter: | Marko Mäkelä | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | corruption, recovery, regression-10.6 | ||
| Issue Links: |
|
||||||||||||||||||||
| Description |
|
The test encryption.innodb-redo-badkey fails on our CI systems quite often like this:
I reduced the test to the minimum so that it would still occasionally fail on my system when being run 64 times concurrently with each other:
There are 2 failure patterns:
and
On 10.5, 64×100 runs of the test completed fine. I tried defining SUX_LOCK_GENERIC on 10.6, but also with that, the test fails. |
| Comments |
| Comment by Marko Mäkelä [ 2022-02-11 ] | |||||||||||||||||||||
|
This regression was introduced between MariaDB Server 10.6.5 and 10.6.6. The failure is very sporadic for some commits. Sometimes, there is no failure within 64×100 runs. The first broken 10.6 commit is a merge of If I revert that I do not think that older versions are really unaffected by this bug; the bug should merely be harder to reproduce. I think that this bug can be fixed by invoking fil_names_dirty(), to guarantee that FILE_MODIFY (or pre- This problem was also observed on Microsoft Windows:
Right before the failure, the test had killed and restarted the server twice in a row:
| |||||||||||||||||||||
| Comment by Marko Mäkelä [ 2022-02-13 ] | |||||||||||||||||||||
|
The following patch fixes the test for me (tested on 10.8):
This code was added in Because of the omission, the first checkpoint that is written after the recovery could be incorrect, unless that checkpoint happened to ‘consume’ more of the log. In the failing case, the checkpoint LSN would be somewhere before the last LSN that was recovered from the log. | |||||||||||||||||||||
| Comment by Marko Mäkelä [ 2022-02-13 ] | |||||||||||||||||||||
|
There was no issue until |