From 68612d166d49fa345f47ccd4f5917f60a5a23266 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Fri, 13 Dec 2024 19:31:58 -0800 Subject: [PATCH] crimson/.../replicated_request: do commit in concurrent phase This allows pipelineing for the actual commit. Signed-off-by: Samuel Just --- src/crimson/osd/osd_operation.h | 6 +++ .../osd/osd_operation_external_tracking.h | 39 ++++++++++++++++++- .../osd/osd_operations/replicated_request.cc | 6 +++ .../osd/osd_operations/replicated_request.h | 2 + 4 files changed, 51 insertions(+), 2 deletions(-) diff --git a/src/crimson/osd/osd_operation.h b/src/crimson/osd/osd_operation.h index 2897a7e1623..f8815a316d1 100644 --- a/src/crimson/osd/osd_operation.h +++ b/src/crimson/osd/osd_operation.h @@ -62,6 +62,12 @@ struct PGRepopPipeline { struct Process : OrderedExclusivePhaseT { static constexpr auto type_name = "PGRepopPipeline::process"; } process; + struct WaitCommit : OrderedConcurrentPhaseT { + static constexpr auto type_name = "PGRepopPipeline::wait_repop"; + } wait_commit; + struct SendReply : OrderedExclusivePhaseT { + static constexpr auto type_name = "PGRepopPipeline::send_reply"; + } send_reply; }; struct CommonOBCPipeline { diff --git a/src/crimson/osd/osd_operation_external_tracking.h b/src/crimson/osd/osd_operation_external_tracking.h index 8dd17bb036d..6a2d7e3ccbd 100644 --- a/src/crimson/osd/osd_operation_external_tracking.h +++ b/src/crimson/osd/osd_operation_external_tracking.h @@ -38,7 +38,10 @@ struct LttngBackend CommonOBCPipeline::WaitRepop::BlockingEvent::Backend, CommonOBCPipeline::WaitRepop::BlockingEvent::ExitBarrierEvent::Backend, CommonOBCPipeline::SendReply::BlockingEvent::Backend, - PGRepopPipeline::Process::BlockingEvent::Backend + PGRepopPipeline::Process::BlockingEvent::Backend, + PGRepopPipeline::WaitCommit::BlockingEvent::Backend, + PGRepopPipeline::WaitCommit::BlockingEvent::ExitBarrierEvent::Backend, + PGRepopPipeline::SendReply::BlockingEvent::Backend { void handle(ClientRequest::StartEvent&, const Operation&) override {} @@ -126,6 +129,20 @@ struct LttngBackend const PGRepopPipeline::Process& blocker) override { } + void handle(PGRepopPipeline::WaitCommit::BlockingEvent& ev, + const Operation& op, + const PGRepopPipeline::WaitCommit& blocker) override { + } + + void handle(PGRepopPipeline::WaitCommit::BlockingEvent::ExitBarrierEvent& ev, + const Operation& op) override { + } + + void handle(PGRepopPipeline::SendReply::BlockingEvent& ev, + const Operation& op, + const PGRepopPipeline::SendReply& blocker) override { + } + void handle(ClientRequest::CompletionEvent&, const Operation&) override {} @@ -150,7 +167,10 @@ struct HistoricBackend CommonOBCPipeline::WaitRepop::BlockingEvent::Backend, CommonOBCPipeline::WaitRepop::BlockingEvent::ExitBarrierEvent::Backend, CommonOBCPipeline::SendReply::BlockingEvent::Backend, - PGRepopPipeline::Process::BlockingEvent::Backend + PGRepopPipeline::Process::BlockingEvent::Backend, + PGRepopPipeline::WaitCommit::BlockingEvent::Backend, + PGRepopPipeline::WaitCommit::BlockingEvent::ExitBarrierEvent::Backend, + PGRepopPipeline::SendReply::BlockingEvent::Backend { void handle(ClientRequest::StartEvent&, const Operation&) override {} @@ -246,6 +266,21 @@ struct HistoricBackend const PGRepopPipeline::Process& blocker) override { } + void handle(PGRepopPipeline::WaitCommit::BlockingEvent& ev, + const Operation& op, + const PGRepopPipeline::WaitCommit& blocker) override { + } + + void handle(PGRepopPipeline::WaitCommit::BlockingEvent::ExitBarrierEvent& ev, + const Operation& op) override { + } + + void handle(PGRepopPipeline::SendReply::BlockingEvent& ev, + const Operation& op, + const PGRepopPipeline::SendReply& blocker) override { + } + + void handle(ClientRequest::CompletionEvent&, const Operation& op) override { if (crimson::common::local_conf()->osd_op_history_size) { to_client_request(op).put_historic(); diff --git a/src/crimson/osd/osd_operations/replicated_request.cc b/src/crimson/osd/osd_operations/replicated_request.cc index 0eb1a270db2..ec607758c55 100644 --- a/src/crimson/osd/osd_operations/replicated_request.cc +++ b/src/crimson/osd/osd_operations/replicated_request.cc @@ -83,8 +83,14 @@ RepRequest::interruptible_future<> RepRequest::with_pg_interruptible( auto [commit_fut, reply] = co_await pg->handle_rep_op(req); + // Transitions from OrderedExclusive->OrderedConcurrent cannot block + this->template enter_stage_sync(repop_pipeline(*pg).wait_commit); + co_await std::move(commit_fut); + co_await this->template enter_stage( + repop_pipeline(*pg).send_reply); + co_await interruptor::make_interruptible( pg->shard_services.send_to_osd( req->from.osd, std::move(reply), pg->get_osdmap_epoch()) diff --git a/src/crimson/osd/osd_operations/replicated_request.h b/src/crimson/osd/osd_operations/replicated_request.h index 3609a51e96f..37d2771a33b 100644 --- a/src/crimson/osd/osd_operations/replicated_request.h +++ b/src/crimson/osd/osd_operations/replicated_request.h @@ -81,6 +81,8 @@ public: ConnectionPipeline::GetPGMapping::BlockingEvent, PerShardPipeline::CreateOrWaitPG::BlockingEvent, PGRepopPipeline::Process::BlockingEvent, + PGRepopPipeline::WaitCommit::BlockingEvent, + PGRepopPipeline::SendReply::BlockingEvent, PG_OSDMapGate::OSDMapBlocker::BlockingEvent, PGMap::PGCreationBlockingEvent, OSD_OSDMapGate::OSDMapBlocker::BlockingEvent -- 2.39.5