Skip to content

Commit eb54228

Browse files
authored
Merge pull request ceph#60958 from xxhdx1985126/wip-69120
crimson/osd/backfill_state: recheck whether needs to scan the primary at the end of Enqueuing::Enqueuing Reviewed-by: Matan Breizman <[email protected]>
2 parents 166e26f + 59377c6 commit eb54228

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

src/crimson/osd/backfill_state.cc

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -381,16 +381,25 @@ BackfillState::Enqueuing::Enqueuing(my_context ctx)
381381
}
382382
} while (!all_emptied(primary_bi, backfill_state().peer_backfill_info));
383383

384-
if (backfill_state().progress_tracker->tracked_objects_completed()
385-
&& Enqueuing::all_enqueued(peering_state(),
386-
backfill_state().backfill_info,
387-
backfill_state().peer_backfill_info)) {
388-
backfill_state().last_backfill_started = hobject_t::get_max();
389-
backfill_listener().update_peers_last_backfill(hobject_t::get_max());
384+
if (should_rescan_primary(backfill_state().peer_backfill_info,
385+
primary_bi)) {
386+
// need to grab one another chunk of the object namespace and restart
387+
// the queueing.
388+
DEBUGDPP("reached end for current local chunk", pg());
389+
post_event(RequestPrimaryScanning{});
390+
return;
391+
} else {
392+
if (backfill_state().progress_tracker->tracked_objects_completed()
393+
&& Enqueuing::all_enqueued(peering_state(),
394+
backfill_state().backfill_info,
395+
backfill_state().peer_backfill_info)) {
396+
backfill_state().last_backfill_started = hobject_t::get_max();
397+
backfill_listener().update_peers_last_backfill(hobject_t::get_max());
398+
}
399+
DEBUGDPP("reached end for both local and all peers "
400+
"but still has in-flight operations", pg());
401+
post_event(RequestWaiting{});
390402
}
391-
DEBUGDPP("reached end for both local and all peers "
392-
"but still has in-flight operations", pg());
393-
post_event(RequestWaiting{});
394403
}
395404

396405
// -- PrimaryScanning

0 commit comments

Comments
 (0)