diff options
author | Vlad Lesin <vlad_lesin@mail.ru> | 2021-01-27 13:59:51 +0300 |
---|---|---|
committer | Vlad Lesin <vlad_lesin@mail.ru> | 2021-01-27 18:42:23 +0300 |
commit | 8f2219130a401f9f67dbf5b2acb45e2883524d81 (patch) | |
tree | 6aadb57fb5c7f66ed8bc0e6463ec033e1852b159 | |
parent | 700ae20d458ff47f53a4df0cf9f1283b015a6bd9 (diff) | |
download | mariadb-git-8f2219130a401f9f67dbf5b2acb45e2883524d81.tar.gz |
MDEV-24705 add check that LSN of the last skipped log record equals to FIL_PAGE_LSN fieldbb-10.5-MDEV-24705-LSN-check
The check is added.
-rw-r--r-- | storage/innobase/log/log0recv.cc | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc index 3f57b1e8e13..e7f5ef1e260 100644 --- a/storage/innobase/log/log0recv.cc +++ b/storage/innobase/log/log0recv.cc @@ -2268,12 +2268,13 @@ static void recv_recover_page(buf_block_t* block, mtr_t& mtr, ut_d(lsn_t recv_start_lsn = 0); const lsn_t init_lsn = init ? init->lsn : 0; + bool skipped_after_init = false; + for (const log_rec_t* recv : p->second.log) { const log_phys_t* l = static_cast<const log_phys_t*>(recv); ut_ad(l->lsn); ut_ad(end_lsn <= l->lsn); - end_lsn = l->lsn; - ut_ad(end_lsn <= log_sys.log.scanned_lsn); + ut_ad(l->lsn <= log_sys.log.scanned_lsn); ut_ad(l->start_lsn); ut_ad(recv_start_lsn <= l->start_lsn); @@ -2286,6 +2287,8 @@ static void recv_recover_page(buf_block_t* block, mtr_t& mtr, block->page.id().space(), block->page.id().page_no(), l->start_lsn, page_lsn)); + skipped_after_init = true; + end_lsn = l->lsn; continue; } @@ -2295,9 +2298,24 @@ static void recv_recover_page(buf_block_t* block, mtr_t& mtr, block->page.id().space(), block->page.id().page_no(), l->start_lsn, init_lsn)); + skipped_after_init = false; + end_lsn = l->lsn; continue; } + /* There is no need to check LSN for just initialized pages. */ + if (skipped_after_init) { + skipped_after_init = false; + ut_ad(end_lsn == page_lsn); + if (end_lsn != page_lsn) + ib::warn() + << "The last skipped log record LSN " + << end_lsn + << " is not equal to page LSN " + << page_lsn; + } + + end_lsn = l->lsn; if (UNIV_UNLIKELY(srv_print_verbose_log == 2)) { ib::info() << "apply " << l->start_lsn |