From 9199727c4eca5d3e380bfe896a0cc70091e5116a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 28 May 2026 08:43:04 +0300 Subject: [PATCH] MDEV-39770 log_t::persist(): Assertion is_opened() == archive failed log_t::persist(): Move a debug assertion after the point that we are actually about to write to the log. For crash recovery, this function may be invoked in such a way that log_sys.archive disagrees with the format of the log file. Reviewed by: Thirunarayanan Balathandayuthapani --- storage/innobase/log/log0log.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc index 6364f9fc49615..aad4f768f0867 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));