Skip to content

Commit 647a723

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
1 parent d9fbc62 commit 647a723

File tree

2 files changed

+4
-20
lines changed

2 files changed

+4
-20
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
--innodb-buffer-pool-size=24M
2+
--innodb-immediate-scrub-data-uncompressed=ON

storage/innobase/mtr/mtr0mtr.cc

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -579,26 +579,9 @@ void mtr_t::commit_shrink(fil_space_t &space)
579579
/* Durably write the reduced FSP_SIZE before truncating the data file. */
580580
log_write_and_flush();
581581

582-
if (m_freed_pages)
583-
{
584-
ut_ad(!m_freed_pages->empty());
585-
ut_ad(m_freed_space == &space);
586-
ut_ad(memo_contains(*m_freed_space));
587-
ut_ad(is_named_space(m_freed_space));
588-
m_freed_space->update_last_freed_lsn(m_commit_lsn);
589-
590-
if (!is_trim_pages())
591-
for (const auto &range : *m_freed_pages)
592-
m_freed_space->add_free_range(range);
593-
else
594-
m_freed_space->clear_freed_ranges();
595-
delete m_freed_pages;
596-
m_freed_pages= nullptr;
597-
m_freed_space= nullptr;
598-
/* mtr_t::start() will reset m_trim_pages */
599-
}
600-
else
601-
ut_ad(!m_freed_space);
582+
ut_ad(!m_freed_pages);
583+
584+
space.clear_freed_ranges();
602585

603586
m_memo.for_each_block_in_reverse(CIterate<Shrink>{space});
604587

0 commit comments

Comments
 (0)