{
LOG_PREFIX(UrgentRecovery::do_recovery);
DEBUGDPPI("{}: {}", *pg, __func__, *this);
- if (!pg->has_reset_since(epoch_started)) {
+ if (pg->has_reset_since(epoch_started)) {
+ return seastar::make_ready_future<bool>(false);
+ }
+
+ return pg->find_unfound(epoch_started
+ ).then_interruptible([this] {
return with_blocking_event<RecoveryBackend::RecoveryBlockingEvent,
interruptor>([this] (auto&& trigger) {
return pg->get_recovery_handler()->recover_missing(trigger, soid, need);
}).then_interruptible([] {
return seastar::make_ready_future<bool>(false);
});
- }
- return seastar::make_ready_future<bool>(false);
+ });
}
void UrgentRecovery::print(std::ostream &lhs) const
if (pg->has_reset_since(epoch_started)) {
return seastar::make_ready_future<bool>(false);
}
- return with_blocking_event<RecoveryBackend::RecoveryBlockingEvent,
- interruptor>([this] (auto&& trigger) {
- return pg->get_recovery_handler()->start_recovery_ops(
- trigger,
- crimson::common::local_conf()->osd_recovery_max_single_start);
+ return pg->find_unfound(epoch_started
+ ).then_interruptible([this] {
+ return with_blocking_event<RecoveryBackend::RecoveryBlockingEvent,
+ interruptor>([this] (auto&& trigger) {
+ return pg->get_recovery_handler()->start_recovery_ops(
+ trigger,
+ crimson::common::local_conf()->osd_recovery_max_single_start);
+ });
});
}
std::chrono::duration_cast<seastar::lowres_clock::duration>(delay));
}
+PG::interruptible_future<> PG::find_unfound(epoch_t epoch_started)
+{
+ if (!have_unfound()) {
+ return interruptor::now();
+ }
+ PeeringCtx rctx;
+ if (!peering_state.discover_all_missing(rctx)) {
+ if (peering_state.state_test(PG_STATE_BACKFILLING)) {
+ logger().debug(
+ "{} {} no luck, giving up on this pg for now (in backfill)",
+ *this, __func__);
+ std::ignore = get_shard_services().start_operation<LocalPeeringEvent>(
+ this,
+ get_pg_whoami(),
+ get_pgid(),
+ epoch_started,
+ epoch_started,
+ PeeringState::UnfoundBackfill());
+ } else if (peering_state.state_test(PG_STATE_RECOVERING)) {
+ logger().debug(
+ "{} {} no luck, giving up on this pg for now (in recovery)",
+ *this, __func__);
+ std::ignore = get_shard_services().start_operation<LocalPeeringEvent>(
+ this,
+ get_pg_whoami(),
+ get_pgid(),
+ epoch_started,
+ epoch_started,
+ PeeringState::UnfoundRecovery());
+ }
+ }
+ return get_shard_services().dispatch_context(get_collection_ref(), std::move(rctx));
+}
+
void PG::recheck_readable()
{
bool changed = false;
// TODO: see PrimaryLogPG::mark_all_unfound_lost()
return seastar::now();
}
+ interruptible_future<> find_unfound(epoch_t epoch_started);
+ bool have_unfound() const {
+ return peering_state.have_unfound();
+ }
bool old_peering_msg(epoch_t reply_epoch, epoch_t query_epoch) const;
friend class SnapTrimEvent;
friend class SnapTrimObjSubEvent;
private:
- seastar::future<bool> find_unfound() {
- return seastar::make_ready_future<bool>(true);
- }
bool can_discard_replica_op(const Message& m, epoch_t m_map_epoch) const;
bool can_discard_op(const MOSDOp& m) const;