From: Samuel Just Date: Fri, 13 Dec 2024 21:36:59 +0000 (+0000) Subject: crimson/.../replicated_request: factor out with_pg_interruptible X-Git-Tag: v20.0.0~458^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7b88c38ac9664d1c3402bedefcb4f6d2e1f910d7;p=ceph.git crimson/.../replicated_request: factor out with_pg_interruptible Signed-off-by: Samuel Just --- diff --git a/src/crimson/osd/osd_operations/replicated_request.cc b/src/crimson/osd/osd_operations/replicated_request.cc index 5e173cf1d516..c8b2bdd38169 100644 --- a/src/crimson/osd/osd_operations/replicated_request.cc +++ b/src/crimson/osd/osd_operations/replicated_request.cc @@ -63,6 +63,24 @@ PGRepopPipeline &RepRequest::repop_pipeline(PG &pg) return pg.repop_pipeline; } +RepRequest::interruptible_future<> RepRequest::with_pg_interruptible( + Ref pg) +{ + LOG_PREFIX(RepRequest::with_pg_interruptible); + DEBUGI("{}", *this); + return this->template enter_stage(repop_pipeline(*pg).process + ).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); + }); +} + seastar::future<> RepRequest::with_pg( ShardServices &shard_services, Ref pg) { @@ -70,19 +88,7 @@ seastar::future<> RepRequest::with_pg( DEBUGI("{}", *this); IRef ref = this; return interruptor::with_interruption([this, pg] { - LOG_PREFIX(RepRequest::with_pg); - DEBUGI("{}: pg present", *this); - return this->template enter_stage(repop_pipeline(*pg).process - ).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); - }); + return with_pg_interruptible(pg); }, [](std::exception_ptr) { return seastar::now(); }, pg, pg->get_osdmap_epoch()).finally([this, ref=std::move(ref)] { diff --git a/src/crimson/osd/osd_operations/replicated_request.h b/src/crimson/osd/osd_operations/replicated_request.h index 1e84fd108e23..3609a51e96f3 100644 --- a/src/crimson/osd/osd_operations/replicated_request.h +++ b/src/crimson/osd/osd_operations/replicated_request.h @@ -68,6 +68,9 @@ public: r_conn = make_local_shared_foreign(std::move(conn)); } + interruptible_future<> with_pg_interruptible( + Ref pg); + seastar::future<> with_pg( ShardServices &shard_services, Ref pg);