From: Radosław Zarzyński Date: Tue, 5 Apr 2022 22:42:38 +0000 (+0200) Subject: crimson/osd: switch one OSDMapGate of ClientRequest to new blocking infra X-Git-Tag: v18.0.0~947^2~38 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=33e4590d4358b7cb55c6561e6f2726c2122504aa;p=ceph.git crimson/osd: switch one OSDMapGate of ClientRequest to new blocking infra 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 --- diff --git a/src/crimson/osd/osd_operations/client_request.cc b/src/crimson/osd/osd_operations/client_request.cc index fd6c20a3b4ac..229a727c3739 100644 --- a/src/crimson/osd/osd_operations/client_request.cc +++ b/src/crimson/osd/osd_operations/client_request.cc @@ -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( + [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] { diff --git a/src/crimson/osd/osd_operations/client_request.h b/src/crimson/osd/osd_operations/client_request.h index c37fc2e64142..a0e1f7acefee 100644 --- a/src/crimson/osd/osd_operations/client_request.h +++ b/src/crimson/osd/osd_operations/client_request.h @@ -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; }; diff --git a/src/crimson/osd/osdmap_gate.h b/src/crimson/osd/osdmap_gate.h index de02d296eede..f378b28825aa 100644 --- a/src/crimson/osd/osdmap_gate.h +++ b/src/crimson/osd/osdmap_gate.h @@ -66,6 +66,7 @@ public: // wait for an osdmap whose epoch is greater or equal to given epoch blocking_future wait_for_map(epoch_t epoch); + // TODO: define me! seastar::future wait_for_map(typename OSDMapBlocker::BlockingEvent::TriggerI&& trigger, epoch_t epoch);