]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: refactor PeeringState::find_best_info() 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. All
it does is just declaring the `min_last_update_acceptable`
closer to its usage.

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

index ecf9c3c6368e250ab1bcc3c7b04b4fc5bdd690c6..f783659d4390bea162436ea9e621dd6c83b7c474 100644 (file)
@@ -1461,7 +1461,6 @@ map<pg_shard_t, pg_info_t>::const_iterator PeeringState::find_best_info(
   /* See doc/dev/osd_internals/last_epoch_started.rst before attempting
    * to make changes to this process.  Also, make sure to update it
    * when you find bugs! */
-  eversion_t min_last_update_acceptable = eversion_t::max();
   epoch_t max_last_epoch_started_found = 0;
   for (auto i = infos.begin(); i != infos.end(); ++i) {
     if (!cct->_conf->osd_find_best_info_ignore_history_les &&
@@ -1475,6 +1474,7 @@ map<pg_shard_t, pg_info_t>::const_iterator PeeringState::find_best_info(
       max_last_epoch_started_found = i->second.last_epoch_started;
     }
   }
+  eversion_t min_last_update_acceptable = eversion_t::max();
   for (auto i = infos.begin(); i != infos.end(); ++i) {
     if (max_last_epoch_started_found <= i->second.last_epoch_started) {
       if (min_last_update_acceptable > i->second.last_update)