MDEV-37553: Assertion failure lsn - get_flushed_lsn(...) < capacity()

log_t::append_prepare_wait(): Relax the debug assertion in case
log_overwrite_warning() has been called. In this case, the
contents of log_sys.buf (and the ib_logfile0) is basically
unrecoverable garbage, and it does not matter which write was
last persisted.

This assertion would easily fail in the 11.4 branch in the test
encryption.innochecksum after merging MDEV-36024.
This commit is contained in:
Marko Mäkelä 2025-09-03 08:45:45 +03:00
commit a304282782

View file

@ -909,7 +909,8 @@ ATTRIBUTE_COLD void log_t::append_prepare_wait(bool late, bool ex) noexcept
const bool is_pmem{is_mmap()};
if (is_pmem)
{
ut_ad(lsn - get_flushed_lsn(std::memory_order_relaxed) < capacity());
ut_ad(lsn - get_flushed_lsn(std::memory_order_relaxed) < capacity() ||
overwrite_warned);
persist(lsn);
}
#endif