From 59377c6eb22f58358f12932b3c6a915de8550159 Mon Sep 17 00:00:00 2001 From: Xuehan Xu Date: Thu, 5 Dec 2024 13:17:55 +0800 Subject: [PATCH] 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 --- src/crimson/osd/backfill_state.cc | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/src/crimson/osd/backfill_state.cc b/src/crimson/osd/backfill_state.cc index 1392ee330ac20..ce8811c4ba20e 100644 --- a/src/crimson/osd/backfill_state.cc +++ b/src/crimson/osd/backfill_state.cc @@ -380,16 +380,25 @@ BackfillState::Enqueuing::Enqueuing(my_context ctx) } } while (!all_emptied(primary_bi, backfill_state().peer_backfill_info)); - if (backfill_state().progress_tracker->tracked_objects_completed() - && Enqueuing::all_enqueued(peering_state(), - backfill_state().backfill_info, - backfill_state().peer_backfill_info)) { - backfill_state().last_backfill_started = hobject_t::get_max(); - backfill_listener().update_peers_last_backfill(hobject_t::get_max()); + if (should_rescan_primary(backfill_state().peer_backfill_info, + primary_bi)) { + // need to grab one another chunk of the object namespace and restart + // the queueing. + DEBUGDPP("reached end for current local chunk", pg()); + post_event(RequestPrimaryScanning{}); + return; + } else { + if (backfill_state().progress_tracker->tracked_objects_completed() + && Enqueuing::all_enqueued(peering_state(), + backfill_state().backfill_info, + backfill_state().peer_backfill_info)) { + backfill_state().last_backfill_started = hobject_t::get_max(); + backfill_listener().update_peers_last_backfill(hobject_t::get_max()); + } + DEBUGDPP("reached end for both local and all peers " + "but still has in-flight operations", pg()); + post_event(RequestWaiting{}); } - DEBUGDPP("reached end for both local and all peers " - "but still has in-flight operations", pg()); - post_event(RequestWaiting{}); } // -- PrimaryScanning -- 2.39.5