Commit d794d348 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-31816 buf_LRU_free_page() does not preserve ROW_FORMAT=COMPRESSED 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 dc1bd180 (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 aaef2e1d (MDEV-27058).
parent 0d175968
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment