diff options
author | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2023-01-20 16:07:43 +0530 |
---|---|---|
committer | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2023-01-20 16:48:43 +0530 |
commit | 645b6c19767421378f702d2d8c795b00e3202d0c (patch) | |
tree | 57750ca8ac8d111a1e5c4ba8196eabca71a7e0c0 | |
parent | 73ecab3d26c055928673a2629f4513aa7008dbf0 (diff) | |
download | mariadb-git-bb-10.5-MDEV-30438.tar.gz |
MDEV-30438 innodb.undo_truncate,4k fails when innodb-immediate-scrub-data-uncompressed is enabledbb-10.5-MDEV-30438
- InnoDB fails to clear the freed ranges during truncation of innodb
undo log tablespace. During shutdown, InnoDB flushes the freed page
ranges and throws the out of bound error.
mtr_t::commit_shrink(): clear the freed ranges while doing undo
tablespace truncation
-rw-r--r-- | mysql-test/suite/innodb/t/undo_truncate.opt | 1 | ||||
-rw-r--r-- | storage/innobase/mtr/mtr0mtr.cc | 23 |
2 files changed, 4 insertions, 20 deletions
diff --git a/mysql-test/suite/innodb/t/undo_truncate.opt b/mysql-test/suite/innodb/t/undo_truncate.opt index f4d78725c6e..1459ec5db74 100644 --- a/mysql-test/suite/innodb/t/undo_truncate.opt +++ b/mysql-test/suite/innodb/t/undo_truncate.opt @@ -1 +1,2 @@ --innodb-buffer-pool-size=24M +--innodb-immediate-scrub-data-uncompressed=ON diff --git a/storage/innobase/mtr/mtr0mtr.cc b/storage/innobase/mtr/mtr0mtr.cc index 0aa5b9a4c3f..7f4812e158a 100644 --- a/storage/innobase/mtr/mtr0mtr.cc +++ b/storage/innobase/mtr/mtr0mtr.cc @@ -579,26 +579,9 @@ void mtr_t::commit_shrink(fil_space_t &space) /* Durably write the reduced FSP_SIZE before truncating the data file. */ log_write_and_flush(); - if (m_freed_pages) - { - ut_ad(!m_freed_pages->empty()); - ut_ad(m_freed_space == &space); - ut_ad(memo_contains(*m_freed_space)); - ut_ad(is_named_space(m_freed_space)); - m_freed_space->update_last_freed_lsn(m_commit_lsn); - - if (!is_trim_pages()) - for (const auto &range : *m_freed_pages) - m_freed_space->add_free_range(range); - else - m_freed_space->clear_freed_ranges(); - delete m_freed_pages; - m_freed_pages= nullptr; - m_freed_space= nullptr; - /* mtr_t::start() will reset m_trim_pages */ - } - else - ut_ad(!m_freed_space); + ut_ad(!m_freed_pages); + + space.clear_freed_ranges(); m_memo.for_each_block_in_reverse(CIterate<Shrink>{space}); |