dout(20) << " active was " << service.recovery_oids[pg->pg_id] << dendl;
#endif
- bool wip = pg->start_recovery_ops(reserved_pushes, handle, &started);
+ bool do_unfound = pg->start_recovery_ops(reserved_pushes, handle, &started);
dout(10) << "do_recovery started " << started << "/" << reserved_pushes
<< " on " << *pg << dendl;
- if (!wip && pg->have_unfound()) {
+ if (do_unfound) {
PG::RecoveryCtx rctx = create_context();
rctx.handle = &handle;
pg->find_unfound(queued, &rctx);
/* TODO: I think this case is broken and will make do_recovery()
* unhappy since we're returning false */
dout(10) << "recovery raced and were queued twice, ignoring!" << dendl;
- return false;
+ return have_unfound();
}
const auto &missing = pg_log.get_missing();
if (!recovering.empty() ||
work_in_progress || recovery_ops_active > 0 || deferred_backfill)
- return work_in_progress;
+ return !work_in_progress && have_unfound();
assert(recovering.empty());
assert(recovery_ops_active == 0);
int unfound = get_num_unfound();
if (unfound) {
dout(10) << " still have " << unfound << " unfound" << dendl;
- return work_in_progress;
+ return true;
}
if (missing.num_missing() > 0) {
// this shouldn't happen!
osd->clog->error() << info.pgid << " Unexpected Error: recovery ending with "
<< missing.num_missing() << ": " << missing.get_items();
- return work_in_progress;
+ return false;
}
if (needs_recovery()) {
// We already checked num_missing() so we must have missing replicas
osd->clog->error() << info.pgid
<< " Unexpected Error: recovery ending with missing replicas";
- return work_in_progress;
+ return false;
}
if (state_test(PG_STATE_RECOVERING)) {