crimson/osd: do not refence PGLog in BackfillState.

This commit makes the backfill code unware about pg log
implementation details. The benefit is easier unit testing.

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
This commit is contained in:
Radoslaw Zarzynski 2020-07-13 14:43:33 +02:00
parent eaa1e967da
commit 670c433050
2 changed files with 6 additions and 3 deletions

View File

@ -35,9 +35,12 @@ struct BackfillState::PeeringFacade {
return peering_state.get_info().log_tail;
}
decltype(auto) get_pg_log() const {
return peering_state.get_pg_log();
template <class... Args>
void scan_log_after(Args&&... args) const {
peering_state.get_pg_log().get_log().scan_log_after(
std::forward<Args>(args)...);
}
bool is_backfill_target(pg_shard_t peer) const {
return peering_state.is_backfill_target(peer);
}

View File

@ -127,7 +127,7 @@ void BackfillState::Enqueuing::maybe_update_range()
primary_bi.version,
pg().get_projected_last_update());
logger().debug("{}: scanning pg log first", __func__);
peering_state().get_pg_log().get_log().scan_log_after(primary_bi.version,
peering_state().scan_log_after(primary_bi.version,
[&](const pg_log_entry_t& e) {
logger().debug("maybe_update_range(lambda): updating from version {}",
e.version);