subops.emplace_back(std::forward<Args>(args)...);
};
-SnapTrimEvent::interruptible_future<>
+SnapTrimEvent::remove_or_update_iertr::future<>
SnapTrimEvent::SubOpBlocker::wait_completion()
{
return interruptor::do_for_each(subops, [](auto&& kv) {
f->close_section();
}
-seastar::future<seastar::stop_iteration> SnapTrimEvent::start()
+SnapTrimEvent::remove_or_update_ertr::future<seastar::stop_iteration>
+SnapTrimEvent::start()
{
logger().debug("{}: {}", *this, __func__);
return with_pg(
return pg->request_pg_pipeline;
}
-seastar::future<seastar::stop_iteration> SnapTrimEvent::with_pg(
+SnapTrimEvent::remove_or_update_ertr::future<seastar::stop_iteration>
+SnapTrimEvent::with_pg(
ShardServices &shard_services, Ref<PG> _pg)
{
return interruptor::with_interruption([&shard_services, this] {
return to_trim;
}).then_interruptible([&shard_services, this] (const auto& to_trim) {
if (to_trim.empty()) {
- // ENOENT
- return interruptor::make_ready_future<seastar::stop_iteration>(
+ // the legit ENOENT -> done
+ return remove_or_update_iertr::make_ready_future<seastar::stop_iteration>(
seastar::stop_iteration::yes);
}
for (const auto& object : to_trim) {
snapid);
subop_blocker.emplace_back(
op->get_id(),
- std::move(fut).handle_error_interruptible(crimson::ct_error::assert_all{})
+ std::move(fut)
);
}
return enter_stage<interruptor>(
).then_interruptible([this] {
logger().debug("{}: awaiting completion", *this);
return subop_blocker.wait_completion();
- }).then_interruptible([this] {
+ }).safe_then_interruptible([this] {
if (!needs_pause) {
return interruptor::now();
}
return seastar::sleep(
std::chrono::milliseconds(std::lround(time_to_sleep * 1000)));
});
- }).then_interruptible([this] {
+ }).safe_then_interruptible([this] {
logger().debug("{}: all completed", *this);
- return interruptor::make_ready_future<seastar::stop_iteration>(
+ return remove_or_update_iertr::make_ready_future<seastar::stop_iteration>(
seastar::stop_iteration::no);
});
});
}, [this](std::exception_ptr eptr) {
// TODO: better debug output
logger().debug("{}: interrupted {}", *this, eptr);
- return seastar::make_ready_future<seastar::stop_iteration>(
+ return remove_or_update_ertr::make_ready_future<seastar::stop_iteration>(
seastar::stop_iteration::no);
}, pg);
}
// trim up to `max` objects for snapshot `snapid
class SnapTrimEvent final : public PhasedOperationT<SnapTrimEvent> {
public:
+ using remove_or_update_ertr =
+ crimson::errorator<crimson::ct_error::enoent>;
+ using remove_or_update_iertr =
+ crimson::interruptible::interruptible_errorator<
+ IOInterruptCondition, remove_or_update_ertr>;
+
static constexpr OperationTypeCode type = OperationTypeCode::snaptrim_event;
SnapTrimEvent(Ref<PG> pg,
void print(std::ostream &) const final;
void dump_detail(ceph::Formatter* f) const final;
- seastar::future<seastar::stop_iteration> start();
- seastar::future<seastar::stop_iteration> with_pg(
+ remove_or_update_ertr::future<seastar::stop_iteration> start();
+ remove_or_update_ertr::future<seastar::stop_iteration> with_pg(
ShardServices &shard_services, Ref<PG> pg);
private:
static constexpr const char* type_name = "CompoundOpBlocker";
using id_done_t = std::pair<crimson::Operation::id_t,
- interruptible_future<>>;
+ remove_or_update_iertr::future<>>;
void dump_detail(Formatter *f) const final;
template <class... Args>
void emplace_back(Args&&... args);
- interruptible_future<> wait_completion();
+ remove_or_update_iertr::future<> wait_completion();
private:
std::vector<id_done_t> subops;
} subop_blocker;