Skip to content

Commit

Permalink
MDEV-25979 Invalid page number written to DB_ROLL_PTR
Browse files Browse the repository at this point in the history
trx_undo_report_row_operation(): Fix a race condition that was introduced
in commit f74023b (MDEV-15090).
We must not access undo_block after the page latch has been released
in mtr_t::commit(), because the block could be evicted or replaced.
  • Loading branch information
dr-m committed Jun 21, 2021
1 parent e46f76c commit 9dc50ea
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions storage/innobase/trx/trx0rec.cc
Expand Up @@ -2054,12 +2054,11 @@ trx_undo_report_row_operation(
goto err_exit;
}

mtr_commit(&mtr);
mtr.commit();
} else {
/* Success */
mtr_commit(&mtr);

undo->top_page_no = undo_block->page.id.page_no();
mtr.commit();
undo->top_offset = offset;
undo->top_undo_no = trx->undo_no++;
undo->guess_block = undo_block;
Expand Down

0 comments on commit 9dc50ea

Please sign in to comment.