]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd/osd_operations: Add RepRequest::with_pg() to the pipeline
authorMatan Breizman <mbreizma@redhat.com>
Sun, 5 Feb 2023 12:01:41 +0000 (12:01 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Tue, 7 Mar 2023 08:57:03 +0000 (08:57 +0000)
Wait on a PG to advance to the request's map epoch.

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
src/crimson/osd/osd_operations/client_request.h
src/crimson/osd/osd_operations/replicated_request.cc
src/crimson/osd/osd_operations/replicated_request.h

index c64e8b97528e4d7eca8ae0f6f4ea3529f7369bbc..a44893b9230e321209a2e8bda7dd70c7afeda1b2 100644 (file)
@@ -41,6 +41,7 @@ class ClientRequest final : public PhasedOperationT<ClientRequest>,
 
 public:
   class PGPipeline : public CommonPGPipeline {
+    public:
     struct AwaitMap : OrderedExclusivePhaseT<AwaitMap> {
       static constexpr auto type_name = "ClientRequest::PGPipeline::await_map";
     } await_map;
index 5dc572d52e2666bbb121444529d7deb44ff435a5..f7d4fa68b2b30443836c191c9d2665bbdb980321 100644 (file)
@@ -58,11 +58,23 @@ seastar::future<> RepRequest::with_pg(
   ShardServices &shard_services, Ref<PG> 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<interruptor>(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);
 }
 
 }
index a7ec30451d94ae4654b97385194177801d2ee215..2716fb0b9293b2847637e99051f6cb72312f8f90 100644 (file)
@@ -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;