Skip to content

Commit

Permalink
MDEV-31816 buf_LRU_free_page() does not preserve ROW_FORMAT=COMPRESSE…
Browse files Browse the repository at this point in the history
…D block state

buf_LRU_free_page(): When we are discarding the uncompressed copy of a
ROW_FORMAT=COMPRESSED page, buf_page_t::can_relocate() must have ensured
that the block descriptor state is one of FREED, UNFIXED, REINIT.
Do not overwrite the state with UNFIXED. We do not want to write back
pages that were actually freed, and we want to avoid doublewrite for
pages that were (re)initialized by log records written since the latest
checkpoint. Last but not least, we do not want crashes like those that
commit dc1bd18 (MDEV-31386)
was supposed to fix.

The test innodb_zip.wl5522_zip should typically cover all 3 states.

This bug is a regression due to
commit aaef2e1 (MDEV-27058).
  • Loading branch information
dr-m committed Aug 1, 2023
1 parent 0d17596 commit d794d34
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion storage/innobase/buf/buf0lru.cc
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,12 @@ bool buf_LRU_free_page(buf_page_t *bpage, bool zip)
mysql_mutex_lock(&buf_pool.flush_list_mutex);
new (b) buf_page_t(*bpage);
b->frame = nullptr;
b->set_state(buf_page_t::UNFIXED + 1);
{
ut_d(uint32_t s=) b->fix();
ut_ad(s == buf_page_t::FREED
|| s == buf_page_t::UNFIXED
|| s == buf_page_t::REINIT);
}
break;
default:
if (zip || !bpage->zip.data || !bpage->frame) {
Expand Down

0 comments on commit d794d34

Please sign in to comment.