From: Radoslaw Zarzynski Date: Tue, 12 Oct 2021 09:38:23 +0000 (+0000) Subject: crimson: osd operations respect interruptor's InterruptCondition. X-Git-Tag: v17.1.0~706^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=e3ad392fd04e9ade3d0fb3fd69f07c3d6bc6c366;p=ceph.git crimson: osd operations respect interruptor's InterruptCondition. For the sake of DRY. Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/crimson/common/interruptible_future.h b/src/crimson/common/interruptible_future.h index f41bc4f3ededd..b490945f0f76d 100644 --- a/src/crimson/common/interruptible_future.h +++ b/src/crimson/common/interruptible_future.h @@ -1034,6 +1034,8 @@ template struct interruptor { public: + using condition = InterruptCond; + template [[gnu::always_inline]] static interruptible_future_detail diff --git a/src/crimson/osd/osd_operations/background_recovery.cc b/src/crimson/osd/osd_operations/background_recovery.cc index 7614cc9102a6c..50089dbeda684 100644 --- a/src/crimson/osd/osd_operations/background_recovery.cc +++ b/src/crimson/osd/osd_operations/background_recovery.cc @@ -70,7 +70,7 @@ UrgentRecovery::do_recovery() { logger().debug("{}: {}", __func__, *this); if (!pg->has_reset_since(epoch_started)) { - return with_blocking_future_interruptible( + return with_blocking_future_interruptible( pg->get_recovery_handler()->recover_missing(soid, need) ).then_interruptible([] { return seastar::make_ready_future(false); @@ -113,7 +113,7 @@ PglogBasedRecovery::do_recovery() { if (pg->has_reset_since(epoch_started)) return seastar::make_ready_future(false); - return with_blocking_future_interruptible( + return with_blocking_future_interruptible( pg->get_recovery_handler()->start_recovery_ops( crimson::common::local_conf()->osd_recovery_max_single_start)); } @@ -134,7 +134,7 @@ BackfillRecovery::do_recovery() return seastar::make_ready_future(false); } // TODO: limits - return with_blocking_future_interruptible( + return with_blocking_future_interruptible( // process_event() of our boost::statechart machine is non-reentrant. // with the backfill_pipeline we protect it from a second entry from // the implementation of BackfillListener. diff --git a/src/crimson/osd/osd_operations/client_request.cc b/src/crimson/osd/osd_operations/client_request.cc index d5d90f4a2061f..3a5111ce0d417 100644 --- a/src/crimson/osd/osd_operations/client_request.cc +++ b/src/crimson/osd/osd_operations/client_request.cc @@ -104,16 +104,16 @@ seastar::future<> ClientRequest::start() return interruptor::now(); }); } - return with_blocking_future_interruptible( + return with_blocking_future_interruptible( handle.enter(pp(pg).await_map) ).then_interruptible([this, &pg] { - return with_blocking_future_interruptible( + return with_blocking_future_interruptible( pg.osdmap_gate.wait_for_map(m->get_min_epoch())); }).then_interruptible([this, &pg](auto map) { - return with_blocking_future_interruptible( + return with_blocking_future_interruptible( handle.enter(pp(pg).wait_for_active)); }).then_interruptible([this, &pg]() { - return with_blocking_future_interruptible( + return with_blocking_future_interruptible( pg.wait_for_active_blocker.wait()); }).then_interruptible([this, pgref=std::move(pgref)]() mutable { if (is_pg_op()) { @@ -157,7 +157,7 @@ ClientRequest::process_pg_op( ClientRequest::interruptible_future<> ClientRequest::process_op(Ref &pg) { - return with_blocking_future_interruptible( + return with_blocking_future_interruptible( handle.enter(pp(*pg).recover_missing)) .then_interruptible( [this, pg]() mutable { @@ -172,14 +172,14 @@ ClientRequest::process_op(Ref &pg) CEPH_OSD_FLAG_ACK | CEPH_OSD_FLAG_ONDISK, false); return conn->send(std::move(reply)); } else { - return with_blocking_future_interruptible( + return with_blocking_future_interruptible( handle.enter(pp(*pg).get_obc)).then_interruptible( [this, pg]() mutable -> PG::load_obc_iertr::future<> { logger().debug("{}: got obc lock", *this); op_info.set_from_op(&*m, *pg->get_osdmap()); return pg->with_locked_obc(m->get_hobj(), op_info, [this, pg](auto obc) mutable { - return with_blocking_future_interruptible( + return with_blocking_future_interruptible( handle.enter(pp(*pg).process) ).then_interruptible([this, pg, obc]() mutable { return do_process(pg, obc); @@ -217,13 +217,13 @@ ClientRequest::do_process(Ref& pg, crimson::osd::ObjectContextRef obc) [this, pg](auto submitted, auto all_completed) mutable { return submitted.then_interruptible( [this, pg] { - return with_blocking_future_interruptible( + return with_blocking_future_interruptible( handle.enter(pp(*pg).wait_repop)); }).then_interruptible( [this, pg, all_completed=std::move(all_completed)]() mutable { return all_completed.safe_then_interruptible( [this, pg](MURef reply) { - return with_blocking_future_interruptible( + return with_blocking_future_interruptible( handle.enter(pp(*pg).send_reply)).then_interruptible( [this, reply=std::move(reply)]() mutable{ return conn->send(std::move(reply)); diff --git a/src/crimson/osd/osd_operations/internal_client_request.cc b/src/crimson/osd/osd_operations/internal_client_request.cc index 3859b388a8cb2..8b15005ef3d20 100644 --- a/src/crimson/osd/osd_operations/internal_client_request.cc +++ b/src/crimson/osd/osd_operations/internal_client_request.cc @@ -43,18 +43,18 @@ seastar::future<> InternalClientRequest::start() return seastar::repeat([this] { logger().debug("{}: in repeat", *this); return interruptor::with_interruption([this]() mutable { - return with_blocking_future_interruptible( + return with_blocking_future_interruptible( handle.enter(pp().wait_for_active) ).then_interruptible([this] { - return with_blocking_future_interruptible( + return with_blocking_future_interruptible( pg->wait_for_active_blocker.wait()); }).then_interruptible([this] { - return with_blocking_future_interruptible( + return with_blocking_future_interruptible( handle.enter(pp().recover_missing) ).then_interruptible([this] { return do_recover_missing(pg, {}); }).then_interruptible([this] { - return with_blocking_future_interruptible( + return with_blocking_future_interruptible( handle.enter(pp().get_obc) ).then_interruptible([this] () -> PG::load_obc_iertr::future<> { logger().debug("{}: getting obc lock", *this); @@ -67,7 +67,7 @@ seastar::future<> InternalClientRequest::start() assert(ret == 0); return pg->with_locked_obc(get_target_oid(), op_info, [&osd_ops, this](auto obc) { - return with_blocking_future_interruptible( + return with_blocking_future_interruptible( handle.enter(pp().process) ).then_interruptible( [obc=std::move(obc), &osd_ops, this] { diff --git a/src/crimson/osd/osd_operations/peering_event.cc b/src/crimson/osd/osd_operations/peering_event.cc index 194876b1d5e13..398fc945a099f 100644 --- a/src/crimson/osd/osd_operations/peering_event.cc +++ b/src/crimson/osd/osd_operations/peering_event.cc @@ -70,18 +70,18 @@ seastar::future<> PeeringEvent::start() return complete_rctx(pg); } logger().debug("{}: pg present", *this); - return with_blocking_future_interruptible( + return with_blocking_future_interruptible( handle.enter(pp(*pg).await_map) ).then_interruptible([this, pg] { - return with_blocking_future_interruptible( + return with_blocking_future_interruptible( pg->osdmap_gate.wait_for_map(evt.get_epoch_sent())); }).then_interruptible([this, pg](auto) { - return with_blocking_future_interruptible( + return with_blocking_future_interruptible( handle.enter(pp(*pg).process)); }).then_interruptible([this, pg] { // TODO: likely we should synchronize also with the pg log-based // recovery. - return with_blocking_future_interruptible( + return with_blocking_future_interruptible( handle.enter(BackfillRecovery::bp(*pg).process)); }).then_interruptible([this, pg] { pg->do_peering_event(evt, ctx);