Skip to content
Permalink
Browse files
MDEV-30438 innodb.undo_truncate,4k fails when innodb-immediate-scrub-…
…data-uncompressed is enabled

- 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
  • Loading branch information
Thirunarayanan committed Jan 23, 2023
1 parent d9fbc62 commit 647a723
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
@@ -1 +1,2 @@
--innodb-buffer-pool-size=24M
--innodb-immediate-scrub-data-uncompressed=ON
@@ -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});

0 comments on commit 647a723

Please sign in to comment.