]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/os/seastore/transaction_manager: pin_to_extent_by_type into coroutines wip-matanb-crimson-seastore-extent-race-v2
authorMatan Breizman <mbreizma@redhat.com>
Wed, 3 Dec 2025 17:55:33 +0000 (17:55 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Wed, 3 Dec 2025 18:08:20 +0000 (18:08 +0000)
Signed-off-by: Matan Breizman <mbreizma@redhat.com>
src/crimson/os/seastore/transaction_manager.h

index 0c595e63f0cfdf0208b0718be6ddda21e5faefff..5ed86ae6086bb9c751cd692a30e94fc83494a0dd 100644 (file)
@@ -1523,54 +1523,32 @@ private:
     assert(is_background_transaction(t.get_src()));
     laddr_t direct_key = pin.get_intermediate_base();
     extent_len_t direct_length = pin.get_intermediate_length();
-    return cache->get_absent_extent_by_type(
+    auto ref = co_await cache->get_absent_extent_by_type(
       t,
       type,
       pin.get_val(),
       direct_key,
       direct_length,
+      // extent_init_func
+      seastar::coroutine::lambda(
       [direct_key, child_pos=std::move(child_pos),
       &t, this](CachedExtent &extent) mutable {
-       assert(extent.is_logical());
-       auto &lextent = static_cast<LogicalChildNode&>(extent);
-       assert(!lextent.has_laddr());
-       assert(!lextent.has_been_invalidated());
-       child_pos.link_child(&lextent);
-       child_pos.invalidate_retired_placeholder(t, *cache, lextent);
-       lextent.set_laddr(direct_key);
+        assert(extent.is_logical());
+        auto &lextent = static_cast<LogicalChildNode&>(extent);
+        assert(!lextent.has_laddr());
+        assert(!lextent.has_been_invalidated());
+        child_pos.link_child(&lextent);
+        child_pos.invalidate_retired_placeholder(t, *cache, lextent);
+        lextent.set_laddr(direct_key);
         // No change to extent::seen_by_user because this path is only
         // for background cleaning.
       }
-    ).si_then([FNAME, &t, pin=pin, this](auto ref) {
-      auto crc = ref->calc_crc32c();
-      SUBTRACET(
-       seastore_tm,
-       "got extent -- {}, chksum in the lba tree: 0x{:x}, actual chksum: 0x{:x}",
-       t,
-       *ref,
-       pin.get_checksum(),
-       crc);
-      assert(ref->is_fully_loaded());
-      bool inconsistent = false;
-      if (full_extent_integrity_check) {
-       inconsistent = (pin.get_checksum() != crc);
-      } else { // !full_extent_integrity_check: remapped extent may be skipped
-       inconsistent = !(pin.get_checksum() == 0 ||
-                        pin.get_checksum() == crc);
-      }
-      if (unlikely(inconsistent)) {
-       SUBERRORT(seastore_tm,
-         "extent checksum inconsistent, recorded: 0x{:x}, actual: 0x{:x}, {}",
-         t,
-         pin.get_checksum(),
-         crc,
-         *ref);
-       ceph_abort();
-      }
-      return pin_to_extent_by_type_ret(
-       interruptible::ready_future_marker{},
-       std::move(ref->template cast<LogicalChildNode>()));
-    });
+    ));
+    SUBDEBUGT(seastore_tm, "got extent -- {} fully_loaded: {}",
+              t, *ref, ref->is_fully_loaded());
+    assert(ref->is_fully_loaded());
+    check_full_extent_integrity(t, ref->calc_crc32c(), pin.get_checksum());
+    co_return std::move(ref->template cast<LogicalChildNode>());
   }
 
   bool get_checksum_needed(paddr_t paddr) {