From 9dc50ea2293640f8153bc806612fd72634498010 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 21 Jun 2021 18:13:28 +0300 Subject: [PATCH] MDEV-25979 Invalid page number written to DB_ROLL_PTR trx_undo_report_row_operation(): Fix a race condition that was introduced in commit f74023b955b5825fc3e957f644d5ee75c8171c98 (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. --- storage/innobase/trx/trx0rec.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/storage/innobase/trx/trx0rec.cc b/storage/innobase/trx/trx0rec.cc index 9c7106facaf..e011b3f5d8e 100644 --- a/storage/innobase/trx/trx0rec.cc +++ b/storage/innobase/trx/trx0rec.cc @@ -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;