]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd/object_context: assert that all in-cache obcs are fully loaded
authorXuehan Xu <xuxuehan@qianxin.com>
Sun, 20 Aug 2023 06:50:48 +0000 (14:50 +0800)
committerXuehan Xu <xuxuehan@qianxin.com>
Tue, 9 Jan 2024 05:45:56 +0000 (13:45 +0800)
Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
src/crimson/osd/object_context.h
src/crimson/osd/object_context_loader.cc

index 8abf6d3f71e96d74e153713d9033a52fe6223a6f..106968e60c3da57c26fbe57081a109114fbfb52e 100644 (file)
@@ -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:
 
index d7d2b6d98c67ae420c01debfd04a0ddded26b2f1..f49de73f5d40af96dd0bfa2a9bae3b3db1619f52 100644 (file)
@@ -168,6 +168,7 @@ using crimson::common::local_conf;
     auto loaded =
       load_obc_iertr::make_ready_future<ObjectContextRef>(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());