Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
13.0
-
Not for Release Notes
Description
I encountered a debug assertion while working on MDEV-14992. The scenario involves crash recovery with innodb_log_file_mmap=ON and a startup with innodb_log_archive=OFF while a log file in the innodb_log_archive=ON format exists (ib_0000000000003000.log).
The assertion would fail when crash recovery is writing back recovered data pages. It invokes log_file_up_to(), which in this case would be a no-op, because the log_sys.flushed_to_disk_lsn would have been recovered from the log. Yet, a debug assertion would fail because we are asserting right before checking that if a write is actually needed. The patch below fixes the issue:
diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc
|
index 6364f9fc496..aad4f768f08 100644
|
--- a/storage/innobase/log/log0log.cc
|
+++ b/storage/innobase/log/log0log.cc
|
@@ -1544,13 +1544,14 @@ void log_t::persist(lsn_t lsn) noexcept
|
ut_ad(!write_lock.is_owner());
|
ut_ad(!flush_lock.is_owner());
|
ut_ad(latch_have_wr());
|
- ut_ad(is_opened() == archive);
|
|
lsn_t old= flushed_to_disk_lsn.load(std::memory_order_relaxed);
|
|
if (old > lsn)
|
return;
|
|
+ ut_ad(is_mmap_writeable());
|
+ ut_ad(is_opened() == archive);
|
const size_t start(calc_lsn_offset(old));
|
const size_t end(calc_lsn_offset(lsn));
|
|
|
Attachments
Issue Links
- is caused by
-
MDEV-37949 Implement innodb_log_archive
-
- Closed
-
- relates to
-
MDEV-39772 InnoDB: Missing FILE_CHECKPOINT when playing with SET GLOBAL innodb_log_archive
-
- Confirmed
-