Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.5
Description
In stress testing, we got an assertion failure due to a call in ibuf_read_merge_pages():
buf_page_get_gen(page_id_t(space_id, page_nos[i]),
|
zip_size,
|
RW_X_LATCH, NULL, BUF_GET,
|
__FILE__, __LINE__, &mtr, &err, true); |
The BUF_GET should actually be BUF_GET_POSSIBLY_FREED, and buf_page_get_gen() must not attempt to merge any buffered changes to freed pages. The scenario likely is something like this:
- INSERT, UPDATE or DELETE is written to the change buffer.
- DROP INDEX is executed and the page is freed, before the buffered changes are merged.
- Something else is written to the change buffer, and ibuf_insert_low() invokes ibuf_read_merge_pages() to merge (or remove) the entries for the page that was freed by DROP INDEX.
Furthermore, MDEV-21572 seems to have broken buf_page_get_gen() so that it will wrongly skip change buffer merge in a rare scenario that I did not verify:
- A secondary index leaf page is initialized and modified.
- The page is evicted.
- Something is buffered for the page.
- All the redo log was durably written, and no log_checkpoint() took place.
- The server is killed.
- On restart, we read the page, but fail to merge the buffered changes.
(It is highly unlikely that the page would be evicted while there would not be a log checkpoint between the page initialization, eviction, and the change buffer write.)
Attachments
Issue Links
- is caused by
-
MDEV-15528 Avoid writing freed InnoDB pages
- Closed
- relates to
-
MDEV-22710 Assertion `mode == 16 || mode == 12 || fix_block->page.status != buf_page_t::FREED' failed in buf_page_get_low
- Closed