dout(10) << "do_recovery started " << started << "/" << reserved_pushes
<< " on " << *pg << dendl;
- // If no recovery op is started, don't bother to manipulate the RecoveryCtx
- if (!started && (wip || !pg->have_unfound())) {
- goto out;
+ if (!wip && pg->have_unfound()) {
+ PG::RecoveryCtx rctx = create_context();
+ rctx.handle = &handle;
+ pg->find_unfound(queued, &rctx);
+ dispatch_context(rctx, pg, pg->get_osdmap());
}
-
- PG::RecoveryCtx rctx = create_context();
- rctx.handle = &handle;
- pg->stuck_on_unfound(queued, wip, &rctx);
- dispatch_context(rctx, pg, pg->get_osdmap());
}
out:
MQuery(from, q, query_epoch))));
}
-void PG::stuck_on_unfound(epoch_t queued, bool wip, RecoveryCtx *rctx)
+void PG::find_unfound(epoch_t queued, RecoveryCtx *rctx)
{
/*
* if we couldn't start any recovery ops and things are still
* It may be that our initial locations were bad and we errored
* out while trying to pull.
*/
- if (!wip && have_unfound()) {
- discover_all_missing(*rctx->query_map);
- if (rctx->query_map->empty()) {
- string action;
- if (state_test(PG_STATE_BACKFILLING)) {
- auto evt = PG::CephPeeringEvtRef(
- new PG::CephPeeringEvt(
- queued,
- queued,
- PG::DeferBackfill(cct->_conf->osd_recovery_retry_interval)));
- queue_peering_event(evt);
- action = "in backfill";
- } else if (state_test(PG_STATE_RECOVERING)) {
- auto evt = PG::CephPeeringEvtRef(
- new PG::CephPeeringEvt(
- queued,
- queued,
- PG::DeferRecovery(cct->_conf->osd_recovery_retry_interval)));
- queue_peering_event(evt);
- action = "in recovery";
- } else {
- action = "already out of recovery/backfill";
- }
- dout(10) << __func__ << ": no luck, giving up on this pg for now (" << action << ")" << dendl;
+ discover_all_missing(*rctx->query_map);
+ if (rctx->query_map->empty()) {
+ string action;
+ if (state_test(PG_STATE_BACKFILLING)) {
+ auto evt = PG::CephPeeringEvtRef(
+ new PG::CephPeeringEvt(
+ queued,
+ queued,
+ PG::DeferBackfill(cct->_conf->osd_recovery_retry_interval)));
+ queue_peering_event(evt);
+ action = "in backfill";
+ } else if (state_test(PG_STATE_RECOVERING)) {
+ auto evt = PG::CephPeeringEvtRef(
+ new PG::CephPeeringEvt(
+ queued,
+ queued,
+ PG::DeferRecovery(cct->_conf->osd_recovery_retry_interval)));
+ queue_peering_event(evt);
+ action = "in recovery";
} else {
- dout(10) << __func__ << ": no luck, giving up on this pg for now (queue_recovery)" << dendl;
- queue_recovery();
+ action = "already out of recovery/backfill";
}
+ dout(10) << __func__ << ": no luck, giving up on this pg for now (" << action << ")" << dendl;
+ } else {
+ dout(10) << __func__ << ": no luck, giving up on this pg for now (queue_recovery)" << dendl;
+ queue_recovery();
}
}