]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: migrate CompoundPeeringRequest into new tracking infra
authorRadosław Zarzyński <rzarzyns@redhat.com>
Wed, 13 Apr 2022 11:24:03 +0000 (13:24 +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_operation_external_tracking.h
src/crimson/osd/osd_operations/compound_peering_request.cc
src/crimson/osd/osd_operations/compound_peering_request.h

index 3eedead0468242d0e7ccba53ea1816d17612eca8..8fc69d95264dcd786254f063ff8d3cfa0f7f9db2 100644 (file)
@@ -6,6 +6,7 @@
 #include "crimson/osd/osdmap_gate.h"
 #include "crimson/osd/osd_operations/background_recovery.h"
 #include "crimson/osd/osd_operations/client_request.h"
+#include "crimson/osd/osd_operations/compound_peering_request.h"
 #include "crimson/osd/osd_operations/peering_event.h"
 #include "crimson/osd/osd_operations/recovery_subrequest.h"
 #include "crimson/osd/osd_operations/replicated_request.h"
@@ -104,6 +105,24 @@ struct LttngBackend
               const Operation&) override {}
 };
 
+struct LttngBackendCompoundPeering
+  : CompoundPeeringRequest::StartEvent::Backend,
+    CompoundPeeringRequest::SubOpBlocker::BlockingEvent::Backend,
+    CompoundPeeringRequest::CompletionEvent::Backend
+{
+  void handle(CompoundPeeringRequest::StartEvent&,
+              const Operation&) override {}
+
+  void handle(CompoundPeeringRequest::SubOpBlocker::BlockingEvent& ev,
+              const Operation& op,
+              const CompoundPeeringRequest::SubOpBlocker& blocker) override {
+  }
+
+  void handle(CompoundPeeringRequest::CompletionEvent&,
+              const Operation&) override {}
+};
+
+
 } // namespace crimson::osd
 
 namespace crimson {
@@ -136,4 +155,11 @@ struct EventBackendRegistry<osd::RecoverySubRequest> {
   }
 };
 
+template <>
+struct EventBackendRegistry<osd::CompoundPeeringRequest> {
+  static std::tuple<osd::LttngBackendCompoundPeering> get_backends() {
+    return { {} };
+  }
+};
+
 } // namespace crimson
index 29c9b437fb8b6bd2e60173cfe2ed1109185be973..286a8c0bb021dc2870743bfec1a322657606593a 100644 (file)
@@ -12,6 +12,7 @@
 #include "crimson/common/exception.h"
 #include "crimson/osd/pg.h"
 #include "crimson/osd/osd.h"
+#include "crimson/osd/osd_operation_external_tracking.h"
 #include "crimson/osd/osd_operations/compound_peering_request.h"
 
 namespace {
@@ -139,9 +140,9 @@ seastar::future<> CompoundPeeringRequest::start()
   logger().info("{}: about to fork future", *this);
   return crimson::common::handle_system_shutdown(
     [this, ref, blocker=std::move(blocker), state]() mutable {
-    return with_blocking_future(
-      blocker->make_blocking_future(state->promise.get_future())
-    ).then([this, blocker=std::move(blocker)](auto &&ctx) {
+    return with_blocking_event<SubOpBlocker::BlockingEvent>([&] (auto&& trigger) {
+      return trigger.maybe_record_blocking(state->promise.get_future(), *blocker);
+    }).then([this, blocker=std::move(blocker)](auto &&ctx) {
       logger().info("{}: sub events complete", *this);
       return osd.get_shard_services().dispatch_context_messages(std::move(ctx));
     }).then([this, ref=std::move(ref)] {
index 411d4919312d4597c45895575474b299ea1813a4..5300095082a1d0f49955cd0fa76298ec946bcf9e 100644 (file)
@@ -19,6 +19,7 @@ class PG;
 using osd_id_t = int;
 
 class CompoundPeeringRequest : public TrackableOperationT<CompoundPeeringRequest> {
+  friend class LttngBackendCompoundPeering;
 public:
   static constexpr OperationTypeCode type =
     OperationTypeCode::compound_peering_request;
@@ -53,6 +54,12 @@ public:
   void print(std::ostream &) const final;
   void dump_detail(Formatter *f) const final;
   seastar::future<> start();
+
+  std::tuple<
+    StartEvent,
+    SubOpBlocker::BlockingEvent,
+    CompletionEvent
+  > tracking_events;
 };
 
 }