From: Xuehan Xu Date: Sun, 20 Aug 2023 06:50:48 +0000 (+0800) Subject: crimson/osd/object_context: assert that all in-cache obcs are fully loaded X-Git-Tag: v19.3.0~184^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=542e0f419e42350a1678d9bb1b9aecaac923077b;p=ceph.git crimson/osd/object_context: assert that all in-cache obcs are fully loaded Signed-off-by: Xuehan Xu --- diff --git a/src/crimson/osd/object_context.h b/src/crimson/osd/object_context.h index 8abf6d3f71e96..106968e60c3da 100644 --- a/src/crimson/osd/object_context.h +++ b/src/crimson/osd/object_context.h @@ -94,11 +94,13 @@ public: ceph_assert(is_head()); obs = std::move(_obs); ssc = std::move(_ssc); + fully_loaded = true; } void set_clone_state(ObjectState &&_obs) { ceph_assert(!is_head()); obs = std::move(_obs); + fully_loaded = true; } /// pass the provided exception to any waiting consumers of this ObjectContext @@ -110,6 +112,10 @@ public: } } + bool is_fully_loaded() const { + return fully_loaded; + } + private: tri_mutex lock; bool recovery_read_marker = false; @@ -126,6 +132,7 @@ private: boost::intrusive::list_member_hook<> list_hook; uint64_t list_link_cnt = 0; + bool fully_loaded = false; public: diff --git a/src/crimson/osd/object_context_loader.cc b/src/crimson/osd/object_context_loader.cc index d7d2b6d98c67a..f49de73f5d40a 100644 --- a/src/crimson/osd/object_context_loader.cc +++ b/src/crimson/osd/object_context_loader.cc @@ -168,6 +168,7 @@ using crimson::common::local_conf; auto loaded = load_obc_iertr::make_ready_future(obc); if (existed) { + ceph_assert(obc->is_fully_loaded()); DEBUGDPP("cache hit on {}", dpp, obc->get_oid()); } else { DEBUGDPP("cache miss on {}", dpp, obc->get_oid());