]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: migrate RepRequest to new tracking infra
authorRadosław Zarzyński <rzarzyns@redhat.com>
Fri, 15 Apr 2022 18:16:09 +0000 (20:16 +0200)
committerRadosław Zarzyński <rzarzyns@redhat.com>
Thu, 5 May 2022 02:06:31 +0000 (04:06 +0200)
Signed-off-by: Radosław Zarzyński <rzarzyns@redhat.com>
src/crimson/osd/osd_operations/replicated_request.cc
src/crimson/osd/osd_operations/replicated_request.h

index 254f76103b83e0ce472edb2cfddf36ee4ba9ad47..3a7068e47cc345ad9d38ae6af80c26cd2d235151 100644 (file)
@@ -8,6 +8,7 @@
 
 #include "crimson/osd/osd.h"
 #include "crimson/osd/osd_connection_priv.h"
+#include "crimson/osd/osd_operation_external_tracking.h"
 #include "crimson/osd/pg.h"
 
 namespace {
@@ -61,13 +62,19 @@ seastar::future<> RepRequest::start()
   logger().debug("{} start", *this);
   IRef ref = this;
 
-  return with_blocking_future(handle.enter(cp().await_map))
-  .then([this]() {
-    return with_blocking_future(osd.osdmap_gate.wait_for_map(req->get_min_epoch()));
+  return enter_stage<>(cp().await_map).then([this] {
+    return with_blocking_event<OSD_OSDMapGate::OSDMapBlocker::BlockingEvent>(
+      [this] (auto&& trigger) {
+        return osd.osdmap_gate.wait_for_map(std::move(trigger),
+                                           req->get_min_epoch());
+      });
   }).then([this](epoch_t epoch) {
-    return with_blocking_future(handle.enter(cp().get_pg));
+    return enter_stage<>(cp().get_pg);
   }).then([this] {
-    return with_blocking_future(osd.wait_for_pg(req->get_spg()));
+    return with_blocking_event<PGMap::PGCreationBlockingEvent>(
+      [this] (auto&& trigger) {
+        return osd.wait_for_pg(std::move(trigger), req->get_spg());
+      });
   }).then([this, ref=std::move(ref)](Ref<PG> pg) {
     return interruptor::with_interruption([this, ref, pg] {
        return pg->handle_rep_op(std::move(req));
index 94cd54fb1e870e432f1e02dbd2a3c765cec81fdd..4e8e97d7106f6fbc8b15639c2899ded4c2576d44 100644 (file)
@@ -4,7 +4,9 @@
 #pragma once
 
 #include "crimson/net/Connection.h"
+#include "crimson/osd/osdmap_gate.h"
 #include "crimson/osd/osd_operation.h"
+#include "crimson/osd/pg_map.h"
 #include "crimson/common/type_helpers.h"
 
 class MOSDRepOp;
@@ -21,21 +23,23 @@ class PG;
 class RepRequest final : public PhasedOperationT<RepRequest> {
 public:
   class ConnectionPipeline {
-    OrderedExclusivePhase await_map = {
-      "RepRequest::ConnectionPipeline::await_map"
-    };
-    OrderedExclusivePhase get_pg = {
-      "RepRequest::ConnectionPipeline::get_pg"
-    };
+    struct AwaitMap : OrderedExclusivePhaseT<AwaitMap> {
+      static constexpr auto type_name =
+       "RepRequest::ConnectionPipeline::await_map";
+    } await_map;
+    struct GetPG : OrderedExclusivePhaseT<GetPG> {
+      static constexpr auto type_name =
+       "RepRequest::ConnectionPipeline::get_pg";
+    } get_pg;
     friend RepRequest;
   };
   class PGPipeline {
-    OrderedExclusivePhase await_map = {
-      "RepRequest::PGPipeline::await_map"
-    };
-    OrderedExclusivePhase process = {
-      "RepRequest::PGPipeline::process"
-    };
+    struct AwaitMap : OrderedExclusivePhaseT<AwaitMap> {
+      static constexpr auto type_name = "RepRequest::PGPipeline::await_map";
+    } await_map;
+    struct Process : OrderedExclusivePhaseT<Process> {
+      static constexpr auto type_name = "RepRequest::PGPipeline::process";
+    } process;
     friend RepRequest;
   };
   static constexpr OperationTypeCode type = OperationTypeCode::replicated_request;
@@ -45,6 +49,13 @@ public:
   void dump_detail(ceph::Formatter* f) const final;
   seastar::future<> start();
 
+  std::tuple<
+    ConnectionPipeline::AwaitMap::BlockingEvent,
+    OSD_OSDMapGate::OSDMapBlocker::BlockingEvent,
+    ConnectionPipeline::GetPG::BlockingEvent,
+    PGMap::PGCreationBlockingEvent
+  > tracking_events;
+
 private:
   ConnectionPipeline &cp();
   PGPipeline &pp(PG &pg);