Skip to content

Commit 325e6aa

Browse files
committed
MDEV-28879 Assertion `l->lsn <= log_sys.get_lsn()' failed around recv_recover_page
recv_recover_page(): Correct a debug assertion to refer to recv_sys.lsn, which may be ahead of log_sys.lsn during non-final recovery batches. In commit 685d958 (MDEV-14425) when some redundant LSN fields were removed, log_sys.log.scanned_lsn had been replaced with a reference to log_sys.lsn instead of the more appropriate recv_sys.lsn. recv_scan_log(): Remove a redundant call to log_sys.set_recovered_lsn(). It suffices to adjust the log_sys.lsn after parsing (and before starting to apply) records for the last batch. Note: Normally, log_sys.lsn must be the latest log sequence number. Before the final recovery batch, this may be safely violated, because log_write_up_to() will be a no-op. That function will be invoked by the buf_flush_page_cleaner thread to initiate writes of recovered pages.
1 parent cb19e21 commit 325e6aa

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

storage/innobase/log/log0recv.cc

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2918,7 +2918,7 @@ static buf_block_t *recv_recover_page(buf_block_t *block, mtr_t &mtr,
29182918
const log_phys_t* l = static_cast<const log_phys_t*>(recv);
29192919
ut_ad(l->lsn);
29202920
ut_ad(end_lsn <= l->lsn);
2921-
ut_ad(l->lsn <= log_sys.get_lsn());
2921+
ut_ad(l->lsn <= recv_sys.lsn);
29222922

29232923
ut_ad(l->start_lsn);
29242924
ut_ad(recv_start_lsn <= l->start_lsn);
@@ -3561,13 +3561,11 @@ void recv_sys_t::apply(bool last_batch)
35613561

35623562
if (last_batch && srv_operation != SRV_OPERATION_RESTORE &&
35633563
srv_operation != SRV_OPERATION_RESTORE_EXPORT)
3564+
/* Instead of flushing, last_batch sorts the buf_pool.flush_list
3565+
in ascending order of buf_page_t::oldest_modification. */
35643566
log_sort_flush_list();
35653567
else
3566-
{
3567-
/* Instead of flushing, last_batch could sort the buf_pool.flush_list
3568-
in ascending order of buf_page_t::oldest_modification. */
35693568
buf_flush_sync_batch(lsn);
3570-
}
35713569

35723570
if (!last_batch)
35733571
{
@@ -3738,7 +3736,6 @@ static bool recv_scan_log(bool last_phase)
37383736
else
37393737
{
37403738
ut_ad(store == STORE_IF_EXISTS);
3741-
log_sys.set_recovered_lsn(recv_sys.lsn);
37423739
recv_sys.apply(false);
37433740
}
37443741
}

0 commit comments

Comments
 (0)