From b35da11bd414b8c7aa7ba3c4269bce4c7766da24 Mon Sep 17 00:00:00 2001 From: Xuehan Xu Date: Mon, 24 Mar 2025 11:35:02 +0800 Subject: [PATCH] crimson/os/seastore/cache: initial_pending extents also do set_io_wait/complete_io/wait_io Fixes: https://tracker.ceph.com/issues/70976 Signed-off-by: Xuehan Xu --- src/crimson/os/seastore/cache.cc | 2 ++ src/crimson/os/seastore/cached_extent.h | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/crimson/os/seastore/cache.cc b/src/crimson/os/seastore/cache.cc index cf83fa93042fd..472c1d57dc3d4 100644 --- a/src/crimson/os/seastore/cache.cc +++ b/src/crimson/os/seastore/cache.cc @@ -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 diff --git a/src/crimson/os/seastore/cached_extent.h b/src/crimson/os/seastore/cached_extent.h index dd34c8fbdabf6..6f8b73bb2ad5b 100644 --- a/src/crimson/os/seastore/cached_extent.h +++ b/src/crimson/os/seastore/cached_extent.h @@ -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 -- 2.39.5