From: Radoslaw Zarzynski Date: Tue, 28 Apr 2020 14:45:52 +0000 (+0200) Subject: osd: refactor PrimaryLogPG::recover_backfill() a little bit. X-Git-Tag: wip-pdonnell-testing-20200918.022351~657^2~18 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=d97f4c60cdcba09e63ac1d50fd4b946feaa42561;p=ceph-ci.git osd: refactor PrimaryLogPG::recover_backfill() a little bit. 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 --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index ce2227cf46a..ff1b9ad8d43 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -13207,9 +13207,6 @@ uint64_t PrimaryLogPG::recover_backfill( } } - hobject_t backfill_pos = - std::min(backfill_info.begin, earliest_peer_backfill()); - for (set::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::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);