From 9498b440e6791261b3d447527bf21cf26a3188b3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rados=C5=82aw=20Zarzy=C5=84ski?= Date: Tue, 19 Apr 2022 14:04:45 +0200 Subject: [PATCH] crimson/osd: migrate RecoverySubRequest to 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_operations/recovery_subrequest.cc | 26 ++++++++++++++++--- .../osd/osd_operations/recovery_subrequest.h | 8 ++++++ 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/src/crimson/osd/osd_operations/recovery_subrequest.cc b/src/crimson/osd/osd_operations/recovery_subrequest.cc index 10546db3a9a..b501b7bbb00 100644 --- a/src/crimson/osd/osd_operations/recovery_subrequest.cc +++ b/src/crimson/osd/osd_operations/recovery_subrequest.cc @@ -10,16 +10,32 @@ namespace { } } +namespace crimson { + template <> + struct EventBackendRegistry { + static std::tuple<> get_backends() { + return {}; + } + }; +} + namespace crimson::osd { seastar::future<> RecoverySubRequest::start() { logger().debug("{}: start", *this); + track_event(); 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( + [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( + [this] (auto&& trigger) { + return osd.wait_for_pg(std::move(trigger), m->get_spg()); + }); }).then([this, opref=std::move(opref)] (Ref 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(); }); } diff --git a/src/crimson/osd/osd_operations/recovery_subrequest.h b/src/crimson/osd/osd_operations/recovery_subrequest.h index 3d496ab5024..1c50b5dd15c 100644 --- a/src/crimson/osd/osd_operations/recovery_subrequest.h +++ b/src/crimson/osd/osd_operations/recovery_subrequest.h @@ -36,6 +36,14 @@ private: OSD& osd; crimson::net::ConnectionRef conn; Ref m; + +public: + std::tuple< + StartEvent, + OSD_OSDMapGate::OSDMapBlocker::BlockingEvent, + PGMap::PGCreationBlockingEvent, + CompletionEvent + > tracking_events; }; } -- 2.39.5