MDEV-31803 InnoDB aborts during recovery when immediate_scrub_data_uncompressed is enabled

Problem:
========
 - InnoDB scans the complete redo log to ensure that there is
no corruption and to find the end of the log. During this scan,
InnoDB saves all the freed ranges, but it doesn't save
recovered size. Later, InnoDB recovery applies partial
redo logs and IO thread tries to flush the all freed
ranges which was noted during previous complete scan of redo logs.

Fix:
====
 InnoDB should store the freed pages only when InnoDB stores
 the redo log records.
This commit is contained in:
Thirunarayanan Balathandayuthapani 2023-07-31 16:42:23 +05:30
parent 732d1ec3ae
commit 941af1fa58

View file

@ -2747,7 +2747,8 @@ restart:
case INIT_PAGE:
last_offset= FIL_PAGE_TYPE;
free_or_init_page:
store_freed_or_init_rec(id, (b & 0x70) == FREE_PAGE);
if (store)
store_freed_or_init_rec(id, (b & 0x70) == FREE_PAGE);
if (UNIV_UNLIKELY(rlen != 0))
goto record_corrupted;
break;