Commit 4cbf75dd authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-33137: Assertion end_lsn == page_lsn failed in recv_recover_page

trx_purge_free_segment(), trx_purge_truncate_rseg_history():
Do not claim that the blocks will be modified in the mini-transaction,
because that will not always be the case. Whenever there is a
modification, mtr_t::set_modified() will flag it.

The debug assertion that failed in recovery is checking that all
changes to data pages are covered by log records. Due to these
incorrect calls, we would unnecessarily write unmodified data pages,
which is something that commit 05fa4558
aims to avoid.

The incorrect calls had originally been added in
commit de31ca6a (MDEV-32820) and
commit 86767bcc (MDEV-29593).

Reviewed by: Vladislav Lesin
Tested by: Elena Stepanova
parent c6c2a2b8
...@@ -378,8 +378,8 @@ static void trx_purge_free_segment(buf_block_t *rseg_hdr, buf_block_t *block, ...@@ -378,8 +378,8 @@ static void trx_purge_free_segment(buf_block_t *rseg_hdr, buf_block_t *block,
ut_ad(rseg_hdr->page.id() == rseg_hdr_id); ut_ad(rseg_hdr->page.id() == rseg_hdr_id);
block->page.lock.x_lock(); block->page.lock.x_lock();
ut_ad(block->page.id() == id); ut_ad(block->page.id() == id);
mtr.memo_push(rseg_hdr, MTR_MEMO_PAGE_X_MODIFY); mtr.memo_push(rseg_hdr, MTR_MEMO_PAGE_X_FIX);
mtr.memo_push(block, MTR_MEMO_PAGE_X_MODIFY); mtr.memo_push(block, MTR_MEMO_PAGE_X_FIX);
} }
while (!fseg_free_step(TRX_UNDO_SEG_HDR + TRX_UNDO_FSEG_HEADER + while (!fseg_free_step(TRX_UNDO_SEG_HDR + TRX_UNDO_FSEG_HEADER +
...@@ -502,7 +502,7 @@ trx_purge_truncate_rseg_history(trx_rseg_t &rseg, ...@@ -502,7 +502,7 @@ trx_purge_truncate_rseg_history(trx_rseg_t &rseg,
mtr.start(); mtr.start();
rseg_hdr->page.lock.x_lock(); rseg_hdr->page.lock.x_lock();
ut_ad(rseg_hdr->page.id() == rseg.page_id()); ut_ad(rseg_hdr->page.id() == rseg.page_id());
mtr.memo_push(rseg_hdr, MTR_MEMO_PAGE_X_MODIFY); mtr.memo_push(rseg_hdr, MTR_MEMO_PAGE_X_FIX);
goto loop; goto loop;
} }
......
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