From f01bb8c7edbb4ea6c0f497b4817751063492a41f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 12 Oct 2026 10:22:40 +0300 Subject: [PATCH] MDEV-41359 Potential hang with innodb_log_archive=ON log_t::checkpoint_margin(): In the target LSN computation, account for the special case resize_log.m_file==log.m_file which signals that a checkpoint write is in progress. Assert that the target checkpoint LSN is sensible. Fixes up commit 3394a9d1148a76268a48ffaaf057b7e333fdb846 (MDEV-37949). Reviewed by: Thirunarayanan Balathandayuthapani --- storage/innobase/log/log0log.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc index 5f4a59b41fc..44e62fd1205 100644 --- a/storage/innobase/log/log0log.cc +++ b/storage/innobase/log/log0log.cc @@ -2075,11 +2075,12 @@ ATTRIBUTE_COLD void log_t::checkpoint_margin() noexcept } lsn-= max_age; } - else if (resize_log.is_opened()) - lsn+= file_size; + else if (resize_log.is_opened() && resize_log.m_file != log.m_file) + lsn+= capacity(); else goto done; + ut_ad(lsn <= get_lsn()); mysql_mutex_lock(&buf_pool.flush_list_mutex); /* We must wait to prevent the tail of the log overwriting the head. */