]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: switch one OSDMapGate of ClientRequest to new blocking infra
authorRadosław Zarzyński <rzarzyns@redhat.com>
Tue, 5 Apr 2022 22:42:38 +0000 (00:42 +0200)
committerRadosław Zarzyński <rzarzyns@redhat.com>
Thu, 5 May 2022 02:06:31 +0000 (04:06 +0200)
This time the demo of `BlockerT::BlockingEvent::TriggerI` which
is supposed to handle situations where:

1) `BlockerT` is separated from `TrackableOperationT` by many
intermediaries while
2) we don't want to templatize them all.

Signed-off-by: Radosław Zarzyński <rzarzyns@redhat.com>
src/crimson/osd/osd_operations/client_request.cc
src/crimson/osd/osd_operations/client_request.h
src/crimson/osd/osdmap_gate.h

index fd6c20a3b4ac067a52a4f5194269c0e586a2ae93..229a727c373968306dec1402012552e546aaffae 100644 (file)
@@ -80,9 +80,11 @@ seastar::future<> ClientRequest::start()
   return seastar::repeat([this, opref=IRef{this}]() mutable {
       logger().debug("{}: in repeat", *this);
       return enter_stage(cp().await_map).then([this]() {
-       return with_blocking_future(
-           osd.osdmap_gate.wait_for_map(
-             m->get_min_epoch()));
+       return with_blocking_event<OSD_OSDMapGate::OSDMapBlocker::BlockingEvent>(
+         [this](auto&& trigger) {
+         return osd.osdmap_gate.wait_for_map(std::move(trigger),
+                                             m->get_min_epoch());
+       });
       }).then([this](epoch_t epoch) {
        return with_blocking_future(handle.enter(cp().get_pg));
       }).then([this] {
index c37fc2e64142fd0eda086e4db2157095ac31b11b..a0e1f7acefeea643547e9750308faf766a312f63 100644 (file)
@@ -6,6 +6,7 @@
 #include "osd/osd_op_util.h"
 #include "crimson/net/Connection.h"
 #include "crimson/osd/object_context.h"
+#include "crimson/osd/osdmap_gate.h"
 #include "crimson/osd/osd_operation.h"
 #include "crimson/osd/osd_operations/client_request_common.h"
 #include "crimson/osd/osd_operations/common/pg_pipeline.h"
@@ -103,7 +104,8 @@ private:
 
 public:
   std::tuple<
-    ConnectionPipeline::AwaitMap::BlockingEvent
+    ConnectionPipeline::AwaitMap::BlockingEvent,
+    OSD_OSDMapGate::OSDMapBlocker::BlockingEvent
   > tracking_events;
 };
 
index de02d296eede3e8e93a5d1a9ae260905876d9abd..f378b28825aae0c6a784f51d105025240e8bbb59 100644 (file)
@@ -66,6 +66,7 @@ public:
   // wait for an osdmap whose epoch is greater or equal to given epoch
   blocking_future<epoch_t>
   wait_for_map(epoch_t epoch);
+  // TODO: define me!
   seastar::future<epoch_t>
   wait_for_map(typename OSDMapBlocker::BlockingEvent::TriggerI&& trigger,
               epoch_t epoch);