]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: migrate InternalClientRequest to new tracking infra.
authorRadosław Zarzyński <rzarzyns@redhat.com>
Tue, 19 Apr 2022 15:32:40 +0000 (17:32 +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/internal_client_request.cc
src/crimson/osd/osd_operations/internal_client_request.h

index b4b61ea66f67d587f866a6dad300445dde3c71b9..cf887f351aa9ec09e6aa1a19810989875c66b7a1 100644 (file)
@@ -11,6 +11,16 @@ namespace {
   }
 }
 
+namespace crimson {
+  template <>
+  struct EventBackendRegistry<osd::InternalClientRequest> {
+    static std::tuple<> get_backends() {
+      return {};
+    }
+  };
+}
+
+
 namespace crimson::osd {
 
 InternalClientRequest::InternalClientRequest(Ref<PG> pg)
@@ -39,23 +49,26 @@ CommonPGPipeline& InternalClientRequest::pp()
 
 seastar::future<> InternalClientRequest::start()
 {
+  track_event<StartEvent>();
   return crimson::common::handle_system_shutdown([this] {
     return seastar::repeat([this] {
       logger().debug("{}: in repeat", *this);
       return interruptor::with_interruption([this]() mutable {
-        return with_blocking_future_interruptible<interruptor::condition>(
-          handle.enter(pp().wait_for_active)
+        return enter_stage<interruptor>(
+         pp().wait_for_active
         ).then_interruptible([this] {
-          return with_blocking_future_interruptible<interruptor::condition>(
-            pg->wait_for_active_blocker.wait());
+          return with_blocking_event<PGActivationBlocker::BlockingEvent,
+                                    interruptor>([this] (auto&& trigger) {
+            return pg->wait_for_active_blocker.wait(std::move(trigger));
+          });
         }).then_interruptible([this] {
-          return with_blocking_future_interruptible<interruptor::condition>(
-            handle.enter(pp().recover_missing)
+          return enter_stage<interruptor>(
+            pp().recover_missing
           ).then_interruptible([this] {
             return do_recover_missing(pg, get_target_oid());
           }).then_interruptible([this] {
-            return with_blocking_future_interruptible<interruptor::condition>(
-              handle.enter(pp().get_obc)
+            return enter_stage<interruptor>(
+              pp().get_obc
             ).then_interruptible([this] () -> PG::load_obc_iertr::future<> {
               logger().debug("{}: getting obc lock", *this);
               return seastar::do_with(create_osd_ops(),
@@ -67,9 +80,7 @@ seastar::future<> InternalClientRequest::start()
                 assert(ret == 0);
                 return pg->with_locked_obc(get_target_oid(), op_info,
                   [&osd_ops, this](auto obc) {
-                  return with_blocking_future_interruptible<interruptor::condition>(
-                    handle.enter(pp().process)
-                  ).then_interruptible(
+                  return enter_stage<interruptor>(pp().process).then_interruptible(
                     [obc=std::move(obc), &osd_ops, this] {
                     return pg->do_osd_ops(
                       std::move(obc),
@@ -109,6 +120,8 @@ seastar::future<> InternalClientRequest::start()
           return seastar::stop_iteration::no;
         }
       }, pg);
+    }).then([this] {
+      track_event<CompletionEvent>();
     });
   });
 }
index a1b538c729e749b55363d4e3bb9c2ef746ede491..6ad77121df07cc2b76ac18920321879784c3468b 100644 (file)
@@ -6,7 +6,9 @@
 #include "crimson/common/type_helpers.h"
 #include "crimson/osd/osd_operation.h"
 #include "crimson/osd/osd_operations/client_request_common.h"
+#include "crimson/osd/osd_operations/common/pg_pipeline.h"
 #include "crimson/osd/pg.h"
+#include "crimson/osd/pg_activation_blocker.h"
 
 namespace crimson::osd {
 
@@ -43,6 +45,17 @@ private:
 
   Ref<PG> pg;
   OpInfo op_info;
+
+public:
+  std::tuple<
+    StartEvent,
+    CommonPGPipeline::WaitForActive::BlockingEvent,
+    PGActivationBlocker::BlockingEvent,
+    CommonPGPipeline::RecoverMissing::BlockingEvent,
+    CommonPGPipeline::GetOBC::BlockingEvent,
+    CommonPGPipeline::Process::BlockingEvent,
+    CompletionEvent
+  > tracking_events;
 };
 
 } // namespace crimson::osd