For the sake of DRY.
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
struct interruptor
{
public:
+ using condition = InterruptCond;
+
template <typename FutureType>
[[gnu::always_inline]]
static interruptible_future_detail<InterruptCond, FutureType>
{
logger().debug("{}: {}", __func__, *this);
if (!pg->has_reset_since(epoch_started)) {
- return with_blocking_future_interruptible<IOInterruptCondition>(
+ return with_blocking_future_interruptible<interruptor::condition>(
pg->get_recovery_handler()->recover_missing(soid, need)
).then_interruptible([] {
return seastar::make_ready_future<bool>(false);
{
if (pg->has_reset_since(epoch_started))
return seastar::make_ready_future<bool>(false);
- return with_blocking_future_interruptible<IOInterruptCondition>(
+ return with_blocking_future_interruptible<interruptor::condition>(
pg->get_recovery_handler()->start_recovery_ops(
crimson::common::local_conf()->osd_recovery_max_single_start));
}
return seastar::make_ready_future<bool>(false);
}
// TODO: limits
- return with_blocking_future_interruptible<IOInterruptCondition>(
+ return with_blocking_future_interruptible<interruptor::condition>(
// 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.
return interruptor::now();
});
}
- return with_blocking_future_interruptible<IOInterruptCondition>(
+ return with_blocking_future_interruptible<interruptor::condition>(
handle.enter(pp(pg).await_map)
).then_interruptible([this, &pg] {
- return with_blocking_future_interruptible<IOInterruptCondition>(
+ return with_blocking_future_interruptible<interruptor::condition>(
pg.osdmap_gate.wait_for_map(m->get_min_epoch()));
}).then_interruptible([this, &pg](auto map) {
- return with_blocking_future_interruptible<IOInterruptCondition>(
+ return with_blocking_future_interruptible<interruptor::condition>(
handle.enter(pp(pg).wait_for_active));
}).then_interruptible([this, &pg]() {
- return with_blocking_future_interruptible<IOInterruptCondition>(
+ return with_blocking_future_interruptible<interruptor::condition>(
pg.wait_for_active_blocker.wait());
}).then_interruptible([this, pgref=std::move(pgref)]() mutable {
if (is_pg_op()) {
ClientRequest::interruptible_future<>
ClientRequest::process_op(Ref<PG> &pg)
{
- return with_blocking_future_interruptible<IOInterruptCondition>(
+ return with_blocking_future_interruptible<interruptor::condition>(
handle.enter(pp(*pg).recover_missing))
.then_interruptible(
[this, pg]() mutable {
CEPH_OSD_FLAG_ACK | CEPH_OSD_FLAG_ONDISK, false);
return conn->send(std::move(reply));
} else {
- return with_blocking_future_interruptible<IOInterruptCondition>(
+ return with_blocking_future_interruptible<interruptor::condition>(
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<IOInterruptCondition>(
+ return with_blocking_future_interruptible<interruptor::condition>(
handle.enter(pp(*pg).process)
).then_interruptible([this, pg, obc]() mutable {
return do_process(pg, obc);
[this, pg](auto submitted, auto all_completed) mutable {
return submitted.then_interruptible(
[this, pg] {
- return with_blocking_future_interruptible<IOInterruptCondition>(
+ return with_blocking_future_interruptible<interruptor::condition>(
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<MOSDOpReply> reply) {
- return with_blocking_future_interruptible<IOInterruptCondition>(
+ return with_blocking_future_interruptible<interruptor::condition>(
handle.enter(pp(*pg).send_reply)).then_interruptible(
[this, reply=std::move(reply)]() mutable{
return conn->send(std::move(reply));
return seastar::repeat([this] {
logger().debug("{}: in repeat", *this);
return interruptor::with_interruption([this]() mutable {
- return with_blocking_future_interruptible<IOInterruptCondition>(
+ return with_blocking_future_interruptible<interruptor::condition>(
handle.enter(pp().wait_for_active)
).then_interruptible([this] {
- return with_blocking_future_interruptible<IOInterruptCondition>(
+ return with_blocking_future_interruptible<interruptor::condition>(
pg->wait_for_active_blocker.wait());
}).then_interruptible([this] {
- return with_blocking_future_interruptible<IOInterruptCondition>(
+ return with_blocking_future_interruptible<interruptor::condition>(
handle.enter(pp().recover_missing)
).then_interruptible([this] {
return do_recover_missing(pg, {});
}).then_interruptible([this] {
- return with_blocking_future_interruptible<IOInterruptCondition>(
+ return with_blocking_future_interruptible<interruptor::condition>(
handle.enter(pp().get_obc)
).then_interruptible([this] () -> PG::load_obc_iertr::future<> {
logger().debug("{}: getting obc lock", *this);
assert(ret == 0);
return pg->with_locked_obc(get_target_oid(), op_info,
[&osd_ops, this](auto obc) {
- return with_blocking_future_interruptible<IOInterruptCondition>(
+ return with_blocking_future_interruptible<interruptor::condition>(
handle.enter(pp().process)
).then_interruptible(
[obc=std::move(obc), &osd_ops, this] {
return complete_rctx(pg);
}
logger().debug("{}: pg present", *this);
- return with_blocking_future_interruptible<IOInterruptCondition>(
+ return with_blocking_future_interruptible<interruptor::condition>(
handle.enter(pp(*pg).await_map)
).then_interruptible([this, pg] {
- return with_blocking_future_interruptible<IOInterruptCondition>(
+ return with_blocking_future_interruptible<interruptor::condition>(
pg->osdmap_gate.wait_for_map(evt.get_epoch_sent()));
}).then_interruptible([this, pg](auto) {
- return with_blocking_future_interruptible<IOInterruptCondition>(
+ return with_blocking_future_interruptible<interruptor::condition>(
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<IOInterruptCondition>(
+ return with_blocking_future_interruptible<interruptor::condition>(
handle.enter(BackfillRecovery::bp(*pg).process));
}).then_interruptible([this, pg] {
pg->do_peering_event(evt, ctx);