Skip to content

Commit 33a3bc2

Browse files
committed
crimson/osd/recovery_backend: scan_for_backfill_primary correctly handle
missing object scan_for_backfill was seperated to scan_for_backfill_primary and scan_for_backfill_replica. The fix from: ceph@88432eb was only copied to the replica version. Fixes: https://tracker.ceph.com/issues/71124 Signed-off-by: Matan Breizman <[email protected]> (cherry picked from commit 2848bc8)
1 parent 2ed4296 commit 33a3bc2

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

src/crimson/osd/recovery_backend.cc

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,12 +238,25 @@ RecoveryBackend::scan_for_backfill_primary(
238238
seastar::coroutine::lambda([FNAME, this, version_map, backfill_targets]
239239
(const hobject_t& object) -> interruptible_future<> {
240240
DEBUGDPP("querying obj:{}", pg, object);
241-
auto obc_manager = pg.obc_loader.get_obc_manager(object);
242-
co_await pg.obc_loader.load_and_lock(
241+
auto obc_manager = pg.obc_loader.get_obc_manager(
242+
object, /* resolve_clone = */ false);
243+
244+
auto found = co_await pg.obc_loader.load_and_lock(
243245
obc_manager, RWState::RWREAD
244-
).handle_error_interruptible(
245-
crimson::ct_error::assert_all("unexpected error")
246+
).si_then([] {
247+
return true;
248+
}).handle_error_interruptible(
249+
crimson::ct_error::enoent::handle([](auto) {
250+
return false;
251+
}),
252+
crimson::ct_error::assert_all(fmt::format("{} {} error when loading obc", pg, FNAME).c_str())
246253
);
254+
if (!found) {
255+
// if the object does not exist here, it must have been removed
256+
// between the collection_list_partial and here. This can happen
257+
// for the first item in the range, which is usually last_backfill.
258+
co_return;
259+
}
247260

248261
if (obc_manager.get_obc()->obs.exists) {
249262
auto version = obc_manager.get_obc()->obs.oi.version;

0 commit comments

Comments
 (0)