]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson: introduce and use repop stage
authorSamuel Just <sjust@redhat.com>
Wed, 27 Nov 2024 02:22:16 +0000 (18:22 -0800)
committerSamuel Just <sjust@redhat.com>
Fri, 13 Dec 2024 20:32:26 +0000 (12:32 -0800)
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 <sjust@redhat.com>
src/crimson/osd/osd_operation.h
src/crimson/osd/osd_operation_external_tracking.h
src/crimson/osd/osd_operations/logmissing_request.cc
src/crimson/osd/osd_operations/logmissing_request.h
src/crimson/osd/osd_operations/replicated_request.cc
src/crimson/osd/osd_operations/replicated_request.h
src/crimson/osd/pg.h

index 43765815bddd6154f96fae78fdb7dd49028773dc..95675fdaad0c0a021d957a58d20f44e23b040277 100644 (file)
@@ -76,6 +76,12 @@ struct CommonPGPipeline {
   } get_obc;
 };
 
+struct PGRepopPipeline {
+  struct Process : OrderedExclusivePhaseT<Process> {
+    static constexpr auto type_name = "PGRepopPipeline::process";
+  } process;
+};
+
 struct CommonOBCPipeline {
   struct Process : OrderedExclusivePhaseT<Process> {
     static constexpr auto type_name = "CommonOBCPipeline::process";
index dec2e89fc2230ad016f5e88e534389d207885df9..c15de31af3b71ffda2a3bc9bc7e1054af7b178c0 100644 (file)
@@ -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();
index 8147c969260f73d44f19e41ff4c077cc6d6001ec..274744cdd92da2f2ad0122eedb2f905c972dc088 100644 (file)
@@ -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<interruptor>(client_pp(*pg).await_map
+    return this->template enter_stage<interruptor>(repop_pipeline(*pg).process
     ).then_interruptible([this, pg] {
       return this->template with_blocking_event<
         PG_OSDMapGate::OSDMapBlocker::BlockingEvent
index 51c9d540cb5ac329ef8da4d9a4c23ac1bcb65438..e12243ce430fd811bd3cdbd1a90db70588ad5060 100644 (file)
@@ -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;
index 5ca11e5dd15eeb4bc0afd9f7ac30fac493907e19..332ec4dfeb766fae5b9018c6429c1ddc54173d8c 100644 (file)
@@ -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<interruptor>(client_pp(*pg).await_map
+    return this->template enter_stage<interruptor>(repop_pipeline(*pg).process
     ).then_interruptible([this, pg] {
       return this->template with_blocking_event<
         PG_OSDMapGate::OSDMapBlocker::BlockingEvent
index ff5dea6d6db3153246bf6760b4d356aa5a2d22c6..1e84fd108e23e1e83dd88093a50959dbdd8a362e 100644 (file)
@@ -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;
index d2afeb59388e9b6155f1d8d494ff584fedca2afc..bfc60299b8a35d79021e6894af2ff122f8afef53 100644 (file)
@@ -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;