auto&& [objects, next] = co_await backend->list_objects(start, max);
co_await interruptor::parallel_for_each(objects, [FNAME, this, version_map]
(const hobject_t& object) -> interruptible_future<> {
- crimson::osd::ObjectContextRef obc;
- if (pg.is_primary()) {
- obc = pg.obc_registry.maybe_get_cached_obc(object);
- }
- if (obc) {
- if (obc->obs.exists) {
- DEBUGDPP("found (primary): {} {}",
- pg, object, obc->obs.oi.version);
- version_map->emplace(object, obc->obs.oi.version);
- } else {
- // if the object does not exist here, it must have been removed
- // between the collection_list_partial and here. This can happen
- // for the first item in the range, which is usually last_backfill.
- }
+ DEBUGDPP("querying obj:{}", pg, object);
+ auto obc_manager = pg.obc_loader.get_obc_manager(object);
+ co_await pg.obc_loader.load_and_lock(
+ obc_manager, RWState::RWREAD
+ ).handle_error_interruptible(
+ crimson::ct_error::assert_all("unexpected error")
+ );
+
+ if (obc_manager.get_obc()->obs.exists) {
+ auto version = obc_manager.get_obc()->obs.oi.version;
+ version_map->emplace(object, version);
+ DEBUGDPP("found: {} {}", pg,
+ object, version);
co_return;
} else {
- auto md =
- co_await backend->load_metadata(object).handle_error_interruptible(
- PGBackend::load_metadata_ertr::assert_all{});
- if (md->os.exists) {
- DEBUGDPP("found: {} {}", pg,
- object, md->os.oi.version);
- version_map->emplace(object, md->os.oi.version);
- }
+ // if the object does not exist here, it must have been removed
+ // between the collection_list_partial and here. This can happen
+ // for the first item in the range, which is usually last_backfill.
co_return;
}
});