]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: migrate RecoverySubRequest to new tracking infra.
authorRadosław Zarzyński <rzarzyns@redhat.com>
Tue, 19 Apr 2022 12:04:45 +0000 (14:04 +0200)
committerRadosław Zarzyński <rzarzyns@redhat.com>
Thu, 5 May 2022 02:06:32 +0000 (04:06 +0200)
Signed-off-by: Radosław Zarzyński <rzarzyns@redhat.com>
src/crimson/osd/osd_operations/recovery_subrequest.cc
src/crimson/osd/osd_operations/recovery_subrequest.h

index 10546db3a9a3ed2cbf1b6fd88f6751b2e9df7b6c..b501b7bbb006f70fc7004aba3476b3dde420ea98 100644 (file)
@@ -10,16 +10,32 @@ namespace {
   }
 }
 
+namespace crimson {
+  template <>
+  struct EventBackendRegistry<osd::RecoverySubRequest> {
+    static std::tuple<> get_backends() {
+      return {};
+    }
+  };
+}
+
 namespace crimson::osd {
 
 seastar::future<> RecoverySubRequest::start() {
   logger().debug("{}: start", *this);
 
+  track_event<StartEvent>();
   IRef opref = this;
-  return with_blocking_future(
-      osd.osdmap_gate.wait_for_map(m->get_min_epoch()))
-  .then([this] (epoch_t epoch) {
-    return with_blocking_future(osd.wait_for_pg(m->get_spg()));
+  using OSDMapBlockingEvent =
+    OSD_OSDMapGate::OSDMapBlocker::BlockingEvent;
+  return with_blocking_event<OSDMapBlockingEvent>(
+    [this] (auto&& trigger) {
+    return osd.osdmap_gate.wait_for_map(std::move(trigger), m->get_min_epoch());
+  }).then([this] (epoch_t epoch) {
+    return with_blocking_event<PGMap::PGCreationBlockingEvent>(
+    [this] (auto&& trigger) {
+      return osd.wait_for_pg(std::move(trigger), m->get_spg());
+    });
   }).then([this, opref=std::move(opref)] (Ref<PG> pgref) {
     return interruptor::with_interruption([this, opref, pgref] {
       return seastar::do_with(std::move(pgref), std::move(opref),
@@ -27,6 +43,8 @@ seastar::future<> RecoverySubRequest::start() {
        return pgref->get_recovery_backend()->handle_recovery_op(m);
       });
     }, [](std::exception_ptr) { return seastar::now(); }, pgref);
+  }).then([this] {
+    track_event<CompletionEvent>();
   });
 }
 
index 3d496ab5024fcf93d565a5581ab5c80a39ae9393..1c50b5dd15cb553881152e5879e412bf4389cd05 100644 (file)
@@ -36,6 +36,14 @@ private:
   OSD& osd;
   crimson::net::ConnectionRef conn;
   Ref<MOSDFastDispatchOp> m;
+
+public:
+  std::tuple<
+    StartEvent,
+    OSD_OSDMapGate::OSDMapBlocker::BlockingEvent,
+    PGMap::PGCreationBlockingEvent,
+    CompletionEvent
+  > tracking_events;
 };
 
 }