From: Radoslaw Zarzynski Date: Mon, 13 Jul 2020 12:34:11 +0000 (+0200) Subject: crimson/osd: drop the depedency on pg_info_t from PGFacade. X-Git-Tag: v17.0.0~463^2~10 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=eaa1e967daa09230b7041be1740f6cb0e97e3c03;p=ceph.git crimson/osd: drop the depedency on pg_info_t from PGFacade. `get_info()` gets replaced with `get_last_update() and `get_log_tail()`. This entirely removes the awareness of `pg_info_t` in the backfill code. Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/crimson/osd/backfill_facades.h b/src/crimson/osd/backfill_facades.h index 3db72324f3b77..ddebfced60368 100644 --- a/src/crimson/osd/backfill_facades.h +++ b/src/crimson/osd/backfill_facades.h @@ -27,8 +27,12 @@ struct BackfillState::PeeringFacade { return peering_state.get_peer_info(peer).last_backfill; } - decltype(auto) get_info() const { - return peering_state.get_info(); + decltype(auto) get_last_update() const { + return peering_state.get_info().last_update; + } + + decltype(auto) get_log_tail() const { + return peering_state.get_info().log_tail; } decltype(auto) get_pg_log() const { diff --git a/src/crimson/osd/backfill_state.cc b/src/crimson/osd/backfill_state.cc index d73e9f00df128..3d1191ec9c043 100644 --- a/src/crimson/osd/backfill_state.cc +++ b/src/crimson/osd/backfill_state.cc @@ -108,7 +108,7 @@ void BackfillState::Enqueuing::maybe_update_range() primary_bi.version >= pg().get_projected_last_update()) { logger().info("{}: bi is current", __func__); ceph_assert(primary_bi.version == pg().get_projected_last_update()); - } else if (primary_bi.version >= peering_state().get_info().log_tail) { + } else if (primary_bi.version >= peering_state().get_log_tail()) { #if 0 if (peering_state().get_pg_log().get_log().empty() && pg().get_projected_log().empty()) { @@ -283,7 +283,7 @@ BackfillState::Enqueuing::Enqueuing(my_context ctx) // update our local interval to cope with recent changes primary_bi.begin = backfill_state().last_backfill_started; - if (primary_bi.version < peering_state().get_info().log_tail) { + if (primary_bi.version < peering_state().get_log_tail()) { // it might be that the OSD is so flooded with modifying operations // that backfill will be spinning here over and over. For the sake // of performance and complexity we don't synchronize with entire PG. @@ -349,8 +349,7 @@ BackfillState::Enqueuing::Enqueuing(my_context ctx) BackfillState::PrimaryScanning::PrimaryScanning(my_context ctx) : my_base(ctx) { - backfill_state().backfill_info.version = \ - peering_state().get_info().last_update; + backfill_state().backfill_info.version = peering_state().get_last_update(); backfill_listener().request_primary_scan( backfill_state().backfill_info.begin); }