]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd/backfill_state: recheck whether needs to scan the primary at 60958/head
authorXuehan Xu <xuxuehan@qianxin.com>
Thu, 5 Dec 2024 05:17:55 +0000 (13:17 +0800)
committerMatan Breizman <mbreizma@redhat.com>
Sun, 5 Jan 2025 14:47:48 +0000 (14:47 +0000)
the end of Enqueuing::Enqueuing

Fixes: https://tracker.ceph.com/issues/69120
Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
src/crimson/osd/backfill_state.cc

index 1392ee330ac2077f37772a62140edb6998c40b89..ce8811c4ba20e0624244f633eaedb81429d291a1 100644 (file)
@@ -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