Skip to content

Commit 59377c6

Browse files
xxhdx1985126Matan-B
authored andcommitted
crimson/osd/backfill_state: recheck whether needs to scan the primary at
the end of Enqueuing::Enqueuing Fixes: https://tracker.ceph.com/issues/69120 Signed-off-by: Xuehan Xu <[email protected]>
1 parent d6d49c9 commit 59377c6

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
@@ -380,16 +380,25 @@ BackfillState::Enqueuing::Enqueuing(my_context ctx)
380380
}
381381
} while (!all_emptied(primary_bi, backfill_state().peer_backfill_info));
382382

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

395404
// -- PrimaryScanning

0 commit comments

Comments
 (0)