]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: drop the depedency on pg_info_t from PGFacade.
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Mon, 13 Jul 2020 12:34:11 +0000 (14:34 +0200)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 1 Dec 2020 12:21:56 +0000 (13:21 +0100)
`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 <rzarzyns@redhat.com>
src/crimson/osd/backfill_facades.h
src/crimson/osd/backfill_state.cc

index 3db72324f3b77869ca68c49d29ce8b78eec449b1..ddebfced603686578738fc20a53004fd60af6d8f 100644 (file)
@@ -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 {
index d73e9f00df12878e9d57f3cf19e23d6350df55ba..3d1191ec9c043739136576c662934e6e2644181d 100644 (file)
@@ -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);
 }