[MDEV-31386] InnoDB: Failing assertion: page_type == i_s_page_type[page_type].type_value Created: 2023-06-01 Updated: 2023-08-01 Resolved: 2023-07-03 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Information Schema, Storage Engine - InnoDB |
| Affects Version/s: | 10.9 |
| Fix Version/s: | 10.6.15, 10.9.8, 10.10.6, 10.11.5, 11.0.3, 11.1.2, 11.2.1 |
| Type: | Bug | Priority: | Blocker |
| Reporter: | Elena Stepanova | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | regression, rr-profile | ||
| Attachments: |
|
||||||||||||||||
| Issue Links: |
|
||||||||||||||||
| Description |
|
Note: I don't have information whether it's happening on other versions, so I'm keeping only "10.9" in affected/fix fields. Please adjust based on the results of the analysis.
|
| Comments |
| Comment by Marko Mäkelä [ 2023-06-02 ] | |||||||||||||||||||||
|
The FIL_PAGE_TYPE of the page on which the assertion fails is 1. That is an invalid value. However, buf_page_t::state() for the block descriptor is FREED, that is, it might not actually be a valid page and the check should perhaps not be evaluated. The block had been freed here:
Deeper analysis will be needed to understand whether the assertion should be simply skipped after buf_page_t::set_freed(), or this is a sign of actual data corruption. | |||||||||||||||||||||
| Comment by Marko Mäkelä [ 2023-06-05 ] | |||||||||||||||||||||
|
The only log record that was applied for the page was FREE_PAGE. Because the contents of freed page frames do not matter, the page frame was never initialized. In all other cases (there had been an INIT_PAGE record, or the page was read from the file system), the buffer page contents should be valid. In this special case, we could actually avoid invoking the recovery altogether, to save some memory. Even if innodb_immediate_scrub_data_uncompressed had been set (it was at the default value OFF here) or the data file used sparse files with page_compressed, recovery could theoretically duplicate the logic of buf_page_t::flush() and avoid allocating a buffer block. I think that we should simply fix i_s_innodb_buffer_page_get_info() so that it will ignore the contents of freed blocks. | |||||||||||||||||||||
| Comment by Marko Mäkelä [ 2023-06-05 ] | |||||||||||||||||||||
|
I tried to come up with a simple test to reproduce this bug, but failed. Here is one attempt; I also tested a kill+restart after DROP INDEX:
elenst, can you please test the following fix?
| |||||||||||||||||||||
| Comment by Elena Stepanova [ 2023-06-05 ] | |||||||||||||||||||||
|
There have been not nearly enough occurrences of the failure in my tests to come up with any statistics and thus to make a conclusion that the problem was solved if the failure doesn't occur in N attempts. | |||||||||||||||||||||
| Comment by Marko Mäkelä [ 2023-06-07 ] | |||||||||||||||||||||
|
I have some ideas for reproducing this bug in the 10.9 branch:
| |||||||||||||||||||||
| Comment by Matthias Leich [ 2023-06-07 ] | |||||||||||||||||||||
|
| |||||||||||||||||||||
| Comment by Matthias Leich [ 2023-06-09 ] | |||||||||||||||||||||
|
I have some replay test. 6 replays on 130 repetitions of the test.
| |||||||||||||||||||||
| Comment by Matthias Leich [ 2023-06-14 ] | |||||||||||||||||||||
|
No replay on origin/10.9 878a86f2764289e6679065b334fef8ca56786948 2023-06-07T14:32:46+03:00 + the patch from above. | |||||||||||||||||||||
| Comment by Marko Mäkelä [ 2023-07-03 ] | |||||||||||||||||||||
|
As part of fixing this, I removed the test innodb.innodb_defragment_fill_factor, because it would depend on information on freed pages being available in information_schema.innodb_buffer_page. The feature that the test is related to was removed in |