]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd: refactor PrimaryLogPG::recover_backfill() a little bit.
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 28 Apr 2020 14:45:52 +0000 (16:45 +0200)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Mon, 13 Jul 2020 14:23:55 +0000 (16:23 +0200)
This is change is intended to only refactor the code.
The main theme is just declaring the `backfill_pos` closer
to its usage.

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/osd/PrimaryLogPG.cc

index ce2227cf46acf8a57388c3c6e99aec1c22b68ea2..ff1b9ad8d435105589c111410d453fe835fd36e0 100644 (file)
@@ -13207,9 +13207,6 @@ uint64_t PrimaryLogPG::recover_backfill(
     }
   }
 
-  hobject_t backfill_pos =
-    std::min(backfill_info.begin, earliest_peer_backfill());
-
   for (set<hobject_t>::iterator i = add_to_stat.begin();
        i != add_to_stat.end();
        ++i) {
@@ -13246,6 +13243,8 @@ uint64_t PrimaryLogPG::recover_backfill(
 
   pgbackend->run_recovery_op(h, get_recovery_op_priority());
 
+  hobject_t backfill_pos =
+    std::min(backfill_info.begin, earliest_peer_backfill());
   dout(5) << "backfill_pos is " << backfill_pos << dendl;
   for (set<hobject_t>::iterator i = backfills_in_flight.begin();
        i != backfills_in_flight.end();
@@ -13264,6 +13263,9 @@ uint64_t PrimaryLogPG::recover_backfill(
        pending_backfill_updates.erase(i++)) {
     dout(20) << " pending_backfill_update " << i->first << dendl;
     ceph_assert(i->first > new_last_backfill);
+    // carried from a previous round – if we are here, then we had to
+    // be requeued (by e.g. on_global_recover()) and those operations
+    // are done.
     recovery_state.update_complete_backfill_object_stats(
       i->first,
       i->second);