From: Samuel Just Date: Wed, 27 Nov 2024 02:22:16 +0000 (-0800) Subject: crimson: introduce and use repop stage X-Git-Tag: v20.0.0~524^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=a051d32790db5f438d155926a374af474455eb2b;p=ceph.git crimson: introduce and use repop stage Repops previously used PGPipeline::await_map. This is actually important as we need them to be processed in order. However, using await_map was confusing and using a single exclusive stage is decidedly unoptimal as we could allow pipelineing on write commit. For now, move them over to their own pipeline stage so we can remove the PGPipeline struct entirely. Later, we'll improve replica write pipelining for better replica-side write concurrency. Signed-off-by: Samuel Just --- diff --git a/src/crimson/osd/osd_operation.h b/src/crimson/osd/osd_operation.h index 43765815bddd6..95675fdaad0c0 100644 --- a/src/crimson/osd/osd_operation.h +++ b/src/crimson/osd/osd_operation.h @@ -76,6 +76,12 @@ struct CommonPGPipeline { } get_obc; }; +struct PGRepopPipeline { + struct Process : OrderedExclusivePhaseT { + static constexpr auto type_name = "PGRepopPipeline::process"; + } process; +}; + struct CommonOBCPipeline { struct Process : OrderedExclusivePhaseT { static constexpr auto type_name = "CommonOBCPipeline::process"; diff --git a/src/crimson/osd/osd_operation_external_tracking.h b/src/crimson/osd/osd_operation_external_tracking.h index dec2e89fc2230..c15de31af3b71 100644 --- a/src/crimson/osd/osd_operation_external_tracking.h +++ b/src/crimson/osd/osd_operation_external_tracking.h @@ -49,7 +49,8 @@ struct LttngBackend CommonOBCPipeline::Process::BlockingEvent::Backend, CommonOBCPipeline::WaitRepop::BlockingEvent::Backend, CommonOBCPipeline::WaitRepop::BlockingEvent::ExitBarrierEvent::Backend, - CommonOBCPipeline::SendReply::BlockingEvent::Backend + CommonOBCPipeline::SendReply::BlockingEvent::Backend, + PGRepopPipeline::Process::BlockingEvent::Backend { void handle(ClientRequest::StartEvent&, const Operation&) override {} @@ -185,6 +186,10 @@ struct LttngBackend const CommonOBCPipeline::SendReply& blocker) override { } + void handle(PGRepopPipeline::Process::BlockingEvent& ev, + const Operation& op, + const PGRepopPipeline::Process& blocker) override { + } void handle(ClientRequest::CompletionEvent&, const Operation&) override {} @@ -221,7 +226,8 @@ struct HistoricBackend CommonOBCPipeline::Process::BlockingEvent::Backend, CommonOBCPipeline::WaitRepop::BlockingEvent::Backend, CommonOBCPipeline::WaitRepop::BlockingEvent::ExitBarrierEvent::Backend, - CommonOBCPipeline::SendReply::BlockingEvent::Backend + CommonOBCPipeline::SendReply::BlockingEvent::Backend, + PGRepopPipeline::Process::BlockingEvent::Backend { void handle(ClientRequest::StartEvent&, const Operation&) override {} @@ -364,6 +370,11 @@ struct HistoricBackend const CommonOBCPipeline::SendReply& blocker) override { } + void handle(PGRepopPipeline::Process::BlockingEvent& ev, + const Operation& op, + const PGRepopPipeline::Process& 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/logmissing_request.cc b/src/crimson/osd/osd_operations/logmissing_request.cc index 8147c969260f7..274744cdd92da 100644 --- a/src/crimson/osd/osd_operations/logmissing_request.cc +++ b/src/crimson/osd/osd_operations/logmissing_request.cc @@ -58,9 +58,9 @@ PerShardPipeline &LogMissingRequest::get_pershard_pipeline( return shard_services.get_replicated_request_pipeline(); } -ClientRequest::PGPipeline &LogMissingRequest::client_pp(PG &pg) +PGRepopPipeline &LogMissingRequest::repop_pipeline(PG &pg) { - return pg.request_pg_pipeline; + return pg.repop_pipeline; } seastar::future<> LogMissingRequest::with_pg( @@ -73,7 +73,7 @@ seastar::future<> LogMissingRequest::with_pg( return interruptor::with_interruption([this, pg] { LOG_PREFIX(LogMissingRequest::with_pg); DEBUGI("{}: pg present", *this); - return this->template enter_stage(client_pp(*pg).await_map + return this->template enter_stage(repop_pipeline(*pg).process ).then_interruptible([this, pg] { return this->template with_blocking_event< PG_OSDMapGate::OSDMapBlocker::BlockingEvent diff --git a/src/crimson/osd/osd_operations/logmissing_request.h b/src/crimson/osd/osd_operations/logmissing_request.h index 51c9d540cb5ac..e12243ce430fd 100644 --- a/src/crimson/osd/osd_operations/logmissing_request.h +++ b/src/crimson/osd/osd_operations/logmissing_request.h @@ -77,14 +77,14 @@ public: ConnectionPipeline::AwaitMap::BlockingEvent, ConnectionPipeline::GetPGMapping::BlockingEvent, PerShardPipeline::CreateOrWaitPG::BlockingEvent, - ClientRequest::PGPipeline::AwaitMap::BlockingEvent, + PGRepopPipeline::Process::BlockingEvent, PG_OSDMapGate::OSDMapBlocker::BlockingEvent, PGMap::PGCreationBlockingEvent, OSD_OSDMapGate::OSDMapBlocker::BlockingEvent > tracking_events; private: - ClientRequest::PGPipeline &client_pp(PG &pg); + PGRepopPipeline &repop_pipeline(PG &pg); crimson::net::ConnectionRef l_conn; crimson::net::ConnectionXcoreRef r_conn; diff --git a/src/crimson/osd/osd_operations/replicated_request.cc b/src/crimson/osd/osd_operations/replicated_request.cc index 5ca11e5dd15ee..332ec4dfeb766 100644 --- a/src/crimson/osd/osd_operations/replicated_request.cc +++ b/src/crimson/osd/osd_operations/replicated_request.cc @@ -58,9 +58,9 @@ PerShardPipeline &RepRequest::get_pershard_pipeline( return shard_services.get_replicated_request_pipeline(); } -ClientRequest::PGPipeline &RepRequest::client_pp(PG &pg) +PGRepopPipeline &RepRequest::repop_pipeline(PG &pg) { - return pg.request_pg_pipeline; + return pg.repop_pipeline; } seastar::future<> RepRequest::with_pg( @@ -72,7 +72,7 @@ seastar::future<> RepRequest::with_pg( return interruptor::with_interruption([this, pg] { LOG_PREFIX(RepRequest::with_pg); DEBUGI("{}: pg present", *this); - return this->template enter_stage(client_pp(*pg).await_map + return this->template enter_stage(repop_pipeline(*pg).process ).then_interruptible([this, pg] { return this->template with_blocking_event< PG_OSDMapGate::OSDMapBlocker::BlockingEvent diff --git a/src/crimson/osd/osd_operations/replicated_request.h b/src/crimson/osd/osd_operations/replicated_request.h index ff5dea6d6db31..1e84fd108e23e 100644 --- a/src/crimson/osd/osd_operations/replicated_request.h +++ b/src/crimson/osd/osd_operations/replicated_request.h @@ -77,14 +77,14 @@ public: ConnectionPipeline::AwaitMap::BlockingEvent, ConnectionPipeline::GetPGMapping::BlockingEvent, PerShardPipeline::CreateOrWaitPG::BlockingEvent, - ClientRequest::PGPipeline::AwaitMap::BlockingEvent, + PGRepopPipeline::Process::BlockingEvent, PG_OSDMapGate::OSDMapBlocker::BlockingEvent, PGMap::PGCreationBlockingEvent, OSD_OSDMapGate::OSDMapBlocker::BlockingEvent > tracking_events; private: - ClientRequest::PGPipeline &client_pp(PG &pg); + PGRepopPipeline &repop_pipeline(PG &pg); crimson::net::ConnectionRef l_conn; crimson::net::ConnectionXcoreRef r_conn; diff --git a/src/crimson/osd/pg.h b/src/crimson/osd/pg.h index d2afeb59388e9..bfc60299b8a35 100644 --- a/src/crimson/osd/pg.h +++ b/src/crimson/osd/pg.h @@ -78,6 +78,7 @@ class PG : public boost::intrusive_ref_counter< using cached_map_t = OSDMapService::cached_map_t; ClientRequest::PGPipeline request_pg_pipeline; + PGRepopPipeline repop_pipeline; PGPeeringPipeline peering_request_pg_pipeline; ClientRequest::Orderer client_request_orderer;