]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/cache: initial_pending extents also do
authorXuehan Xu <xuxuehan@qianxin.com>
Mon, 24 Mar 2025 03:35:02 +0000 (11:35 +0800)
committerXuehan Xu <xuxuehan@qianxin.com>
Wed, 28 May 2025 02:30:18 +0000 (10:30 +0800)
set_io_wait/complete_io/wait_io

Fixes: https://tracker.ceph.com/issues/70976
Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
src/crimson/os/seastore/cache.cc
src/crimson/os/seastore/cached_extent.h

index cf83fa93042fd06edbab4383c36a7fec73ebd3e3..472c1d57dc3d46280ff31a9e40c08b02e80a8771 100644 (file)
@@ -1365,6 +1365,7 @@ record_t Cache::prepare_record(
     // retiering extents, this is because logical linked tree
     // nodes needs to access their prior instances in this
     // phase if they are rewritten.
+    e->set_io_wait();
     e->prepare_commit();
   });
 
@@ -1796,6 +1797,7 @@ void Cache::complete_commit(
     assert(!i->is_dirty());
     const auto t_src = t.get_src();
     touch_extent(*i, &t_src, t.get_cache_hint());
+    i->complete_io();
     epm.commit_space_used(i->get_paddr(), i->get_length());
 
     // Note: commit extents and backref allocations in the same place
index dd34c8fbdabf69d98796c67e309b9d93042c5af1..6f8b73bb2ad5bb2651a609c5a601fc13cb34e7b6 100644 (file)
@@ -549,12 +549,12 @@ public:
   }
 
   bool is_stable_writting() const {
-    // MUTATION_PENDING and under-io extents are already stable and visible,
-    // see prepare_record().
+    // MUTATION_PENDING/INITIAL_WRITE_PENDING and under-io extents are already
+    // stable and visible, see prepare_record().
     //
-    // XXX: It might be good to mark this case as DIRTY from the definition,
+    // XXX: It might be good to mark this case as DIRTY/CLEAN from the definition,
     // which probably can make things simpler.
-    return is_mutation_pending() && is_pending_io();
+    return (is_mutation_pending() || is_initial_pending()) && is_pending_io();
   }
 
   /// Returns true if extent is stable and shared among transactions