Commit
8f95695ee2e ("crimson/os/seastore: ensure extent is loaded if
missing from cache") added a fallback reload in resync_node for the
case where t.get_extent() doesn't find the extent:
if (!node) {
node = co_await log_load_extent<LogNode>(
t, e->get_laddr(), BEGIN_KEY, END_KEY);
}
but left the pre-existing assert(ret == PRESENT) in place right above
it. In debug builds the assert fires before the fallback can run, so
any legitimately absent extent crashes the OSD on a pgmeta write.
Drop the PRESENT assert so the reload path actually runs. Keep a
weaker guard against RETIRED, which would mean the caller is
resyncing an extent it already removed in the same transaction
(that's a real logic bug).
Tracker: https://tracker.ceph.com/issues/75521
Tracker: https://tracker.ceph.com/issues/75520
Signed-off-by: Lumir Sliva <61183145+lumir-sliva@users.noreply.github.com>
auto resync_node = [&](LogNodeRef e)
-> log_load_extent_iertr::future<CachedExtentRef> {
CachedExtentRef node;
- [[maybe_unused]] Transaction::get_extent_ret ret;
- // To find mutable extent in the same transaction
- ret = t.get_extent(e->get_paddr(), &node);
- assert(ret == Transaction::get_extent_ret::PRESENT);
+ // Look for a mutable version already tracked by this transaction.
+ auto ret = t.get_extent(e->get_paddr(), &node);
+ // ABSENT is expected when the target LogNode was newly created and is
+ // not yet tracked in the transaction's extent cache; fall through to a
+ // full reload below. RETIRED would mean the caller is resyncing an
+ // extent already removed in this transaction, which is a real logic bug.
+ ceph_assert(ret != Transaction::get_extent_ret::RETIRED);
if (!node) {
// Do full reload if not cached
node = co_await log_load_extent<LogNode>(