]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/osd: move perf counter ownership to OSDSingletonState
authorSamuel Just <sjust@redhat.com>
Wed, 31 Aug 2022 22:20:25 +0000 (15:20 -0700)
committerSamuel Just <sjust@redhat.com>
Tue, 27 Sep 2022 02:35:41 +0000 (19:35 -0700)
Later, we'll want to create a properly sharded implentation that avoids
barriers.

Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/osd/pg_shard_manager.cc
src/crimson/osd/shard_services.cc
src/crimson/osd/shard_services.h

index 84b17e721f952033da5c8e0cc3b6ce3a3a79951f..9913d966f63fb579be34716c3e769faa8cf5eb9d 100644 (file)
@@ -27,7 +27,12 @@ seastar::future<> PGShardManager::start(
   ).then([this, whoami, &store] {
     ceph::mono_time startup_time = ceph::mono_clock::now();
     return shard_services.start(
-      std::ref(osd_singleton_state), whoami, startup_time, std::ref(store));
+      std::ref(osd_singleton_state),
+      whoami,
+      startup_time,
+      osd_singleton_state.local().perf,
+      osd_singleton_state.local().recoverystate_perf,
+      std::ref(store));
   });
 }
 
index f9f0cb393b00f0c11f8ee6430a1cee6c20a874fc..bc5a02c3d3ccff59202d11d533910eb0e41a68d4 100644 (file)
@@ -36,22 +36,19 @@ namespace crimson::osd {
 PerShardState::PerShardState(
   int whoami,
   ceph::mono_time startup_time,
+  PerfCounters *perf,
+  PerfCounters *recoverystate_perf,
   crimson::os::FuturizedStore &store)
   : whoami(whoami),
     store(store),
+    perf(perf), recoverystate_perf(recoverystate_perf),
     throttler(crimson::common::local_conf()),
     obc_registry(crimson::common::local_conf()),
     next_tid(
       static_cast<ceph_tid_t>(seastar::this_shard_id()) <<
       (std::numeric_limits<ceph_tid_t>::digits - 8)),
     startup_time(startup_time)
-{
-  perf = build_osd_logger(&cct);
-  cct.get_perfcounters_collection()->add(perf);
-
-  recoverystate_perf = build_recoverystate_perf(&cct);
-  cct.get_perfcounters_collection()->add(recoverystate_perf);
-}
+{}
 
 seastar::future<> PerShardState::stop_pgs()
 {
@@ -130,6 +127,12 @@ OSDSingletonState::OSDSingletonState(
 {
   crimson::common::local_conf().add_observer(this);
   osdmaps[0] = boost::make_local_shared<OSDMap>();
+
+  perf = build_osd_logger(&cct);
+  cct.get_perfcounters_collection()->add(perf);
+
+  recoverystate_perf = build_recoverystate_perf(&cct);
+  cct.get_perfcounters_collection()->add(recoverystate_perf);
 }
 
 seastar::future<> OSDSingletonState::send_to_osd(
index b5f9a388c615310678176714a412ece56f6fa2f8..63e251a1366f54191eed6b9d62205df77d56267c 100644 (file)
@@ -145,6 +145,8 @@ public:
   PerShardState(
     int whoami,
     ceph::mono_time startup_time,
+    PerfCounters *perf,
+    PerfCounters *recoverystate_perf,
     crimson::os::FuturizedStore &store);
 };
 
@@ -172,6 +174,8 @@ private:
   const int whoami;
 
   crimson::common::CephContext cct;
+  PerfCounters *perf = nullptr;
+  PerfCounters *recoverystate_perf = nullptr;
 
   OSDState osd_state;