MDEV-32811 Potentially broken crash recovery if a mini-transaction frees a...

MDEV-32811 Potentially broken crash recovery if a mini-transaction frees a page, not modifying previously clean pages

- The 11.2 test innodb.sys_truncate_debug fails while executing insert statement.
Reason for the failure is that same mini-transaction does freeing, allocating
and freeing the same page. Page initialization clears the FIL_PAGE_LSN
on the page, fails to set the FIL_PAGE_LSN after freeing the same page.
This issue is caused by commit f46efb44

mtr_t::commit(): Should set the FIL_PAGE_LSN even though page is freed
parent ae0afad5
......@@ -420,13 +420,10 @@ void mtr_t::commit()
ut_ad(s < buf_page_t::READ_FIX);
ut_ad(mach_read_from_8(bpage->frame + FIL_PAGE_LSN) <=
m_commit_lsn);
if (s >= buf_page_t::UNFIXED)
{
mach_write_to_8(bpage->frame + FIL_PAGE_LSN, m_commit_lsn);
if (UNIV_LIKELY_NULL(bpage->zip.data))
memcpy_aligned<8>(FIL_PAGE_LSN + bpage->zip.data,
FIL_PAGE_LSN + bpage->frame, 8);
}
mach_write_to_8(bpage->frame + FIL_PAGE_LSN, m_commit_lsn);
if (UNIV_LIKELY_NULL(bpage->zip.data))
memcpy_aligned<8>(FIL_PAGE_LSN + bpage->zip.data,
FIL_PAGE_LSN + bpage->frame, 8);
modified++;
}
switch (auto latch= slot.type & ~MTR_MEMO_MODIFY) {
......
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