From 275954fc0e505cadcdb37f3247f61449b6d24ca7 Mon Sep 17 00:00:00 2001 From: Matan Breizman Date: Sun, 5 Feb 2023 12:01:41 +0000 Subject: [PATCH] crimson/osd/osd_operations: Add RepRequest::with_pg() to the pipeline Wait on a PG to advance to the request's map epoch. Signed-off-by: Matan Breizman (cherry picked from commit cc53ae651249a24ab3e6844823bec6fe65fd7cd3) --- .../osd/osd_operations/client_request.h | 1 + .../osd/osd_operations/replicated_request.cc | 18 +++++++++++++++--- .../osd/osd_operations/replicated_request.h | 2 ++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/crimson/osd/osd_operations/client_request.h b/src/crimson/osd/osd_operations/client_request.h index c64e8b97528..a44893b9230 100644 --- a/src/crimson/osd/osd_operations/client_request.h +++ b/src/crimson/osd/osd_operations/client_request.h @@ -41,6 +41,7 @@ class ClientRequest final : public PhasedOperationT, public: class PGPipeline : public CommonPGPipeline { + public: struct AwaitMap : OrderedExclusivePhaseT { static constexpr auto type_name = "ClientRequest::PGPipeline::await_map"; } await_map; diff --git a/src/crimson/osd/osd_operations/replicated_request.cc b/src/crimson/osd/osd_operations/replicated_request.cc index 5dc572d52e2..f7d4fa68b2b 100644 --- a/src/crimson/osd/osd_operations/replicated_request.cc +++ b/src/crimson/osd/osd_operations/replicated_request.cc @@ -58,11 +58,23 @@ seastar::future<> RepRequest::with_pg( ShardServices &shard_services, Ref pg) { logger().debug("{}: RepRequest::with_pg", *this); - IRef ref = this; return interruptor::with_interruption([this, pg] { - return pg->handle_rep_op(req); - }, [ref](std::exception_ptr) { return seastar::now(); }, pg); + logger().debug("{}: pg present", *this); + return this->template enter_stage(pp(*pg).await_map + ).then_interruptible([this, pg] { + return this->template with_blocking_event< + PG_OSDMapGate::OSDMapBlocker::BlockingEvent + >([this, pg](auto &&trigger) { + return pg->osdmap_gate.wait_for_map( + std::move(trigger), req->min_epoch); + }); + }).then_interruptible([this, pg] (auto) { + return pg->handle_rep_op(req); + }); + }, [ref](std::exception_ptr) { + return seastar::now(); + }, pg); } } diff --git a/src/crimson/osd/osd_operations/replicated_request.h b/src/crimson/osd/osd_operations/replicated_request.h index a7ec30451d9..2716fb0b929 100644 --- a/src/crimson/osd/osd_operations/replicated_request.h +++ b/src/crimson/osd/osd_operations/replicated_request.h @@ -46,6 +46,8 @@ public: ConnectionPipeline::AwaitActive::BlockingEvent, ConnectionPipeline::AwaitMap::BlockingEvent, ConnectionPipeline::GetPG::BlockingEvent, + ClientRequest::PGPipeline::AwaitMap::BlockingEvent, + PG_OSDMapGate::OSDMapBlocker::BlockingEvent, PGMap::PGCreationBlockingEvent, OSD_OSDMapGate::OSDMapBlocker::BlockingEvent > tracking_events; -- 2.39.5