From d3d7745c3a9ac14c14898094949d8e041ef06c33 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rados=C5=82aw=20Zarzy=C5=84ski?= Date: Wed, 13 Apr 2022 13:24:03 +0200 Subject: [PATCH] crimson/osd: migrate CompoundPeeringRequest into new tracking infra MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Radosław Zarzyński --- .../osd/osd_operation_external_tracking.h | 26 +++++++++++++++++++ .../compound_peering_request.cc | 7 ++--- .../osd_operations/compound_peering_request.h | 7 +++++ 3 files changed, 37 insertions(+), 3 deletions(-) diff --git a/src/crimson/osd/osd_operation_external_tracking.h b/src/crimson/osd/osd_operation_external_tracking.h index 3eedead0468..8fc69d95264 100644 --- a/src/crimson/osd/osd_operation_external_tracking.h +++ b/src/crimson/osd/osd_operation_external_tracking.h @@ -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 { } }; +template <> +struct EventBackendRegistry { + static std::tuple get_backends() { + return { {} }; + } +}; + } // namespace crimson diff --git a/src/crimson/osd/osd_operations/compound_peering_request.cc b/src/crimson/osd/osd_operations/compound_peering_request.cc index 29c9b437fb8..286a8c0bb02 100644 --- a/src/crimson/osd/osd_operations/compound_peering_request.cc +++ b/src/crimson/osd/osd_operations/compound_peering_request.cc @@ -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([&] (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)] { diff --git a/src/crimson/osd/osd_operations/compound_peering_request.h b/src/crimson/osd/osd_operations/compound_peering_request.h index 411d4919312..5300095082a 100644 --- a/src/crimson/osd/osd_operations/compound_peering_request.h +++ b/src/crimson/osd/osd_operations/compound_peering_request.h @@ -19,6 +19,7 @@ class PG; using osd_id_t = int; class CompoundPeeringRequest : public TrackableOperationT { + 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; }; } -- 2.39.5