diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc index f0ef7a43fc506..ca383f1720bea 100644 --- a/storage/innobase/buf/buf0flu.cc +++ b/storage/innobase/buf/buf0flu.cc @@ -93,6 +93,8 @@ class async_flush_lsn void try_clear_if_at_most(lsn_t threshold) noexcept { lsn_t snapshot= m_lsn.load(); + if (!snapshot) + return; /* already cleared: avoid a redundant atomic CAS */ if (threshold >= snapshot) m_lsn.compare_exchange_strong(snapshot, 0); }