]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore: drop dead PRESENT assert in LogManager::resync_node 68596/head
authorLumir Sliva <61183145+lumir-sliva@users.noreply.github.com>
Thu, 23 Apr 2026 23:39:01 +0000 (01:39 +0200)
committerSlíva, Lumír <61183145+lumir-sliva@users.noreply.github.com>
Thu, 18 Jun 2026 14:56:39 +0000 (16:56 +0200)
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>
src/crimson/os/seastore/omap_manager/log/log_manager.cc

index 03f16875c5c38af5fc25d85522a9da07042092fe..b3f7a0f8e1048211cef669132cf970a607a0c1f6 100644 (file)
@@ -70,10 +70,13 @@ LogManager::omap_set_keys(
   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>(