]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
PG::find_best_info: let history.last_epoch_started provide a lower bound 2519/head
authorSamuel Just <sam.just@inktank.com>
Mon, 15 Sep 2014 23:53:21 +0000 (16:53 -0700)
committerSamuel Just <sam.just@inktank.com>
Wed, 17 Sep 2014 03:52:36 +0000 (20:52 -0700)
If we find a info.history.last_epoch_started above any
info.last_epoch_started, we must be missing updates and
min_last_update_acceptable should provisionally be max().

Fixes: #9482
Backport: firefly
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/PG.cc

index 2c86f3ba2d2511875be56256b2f2dedbe98f2da2..826b55939b5039af2e9a6882076c7d36908b1403 100644 (file)
@@ -867,6 +867,10 @@ map<pg_shard_t, pg_info_t>::const_iterator PG::find_best_info(
   for (map<pg_shard_t, pg_info_t>::const_iterator i = infos.begin();
        i != infos.end();
        ++i) {
+    if (max_last_epoch_started_found < i->second.history.last_epoch_started) {
+      min_last_update_acceptable = eversion_t::max();
+      max_last_epoch_started_found = i->second.history.last_epoch_started;
+    }
     if (max_last_epoch_started_found < i->second.last_epoch_started) {
       min_last_update_acceptable = eversion_t::max();
       max_last_epoch_started_found = i->second.last_epoch_started;
@@ -876,7 +880,8 @@ map<pg_shard_t, pg_info_t>::const_iterator PG::find_best_info(
        min_last_update_acceptable = i->second.last_update;
     }
   }
-  assert(min_last_update_acceptable != eversion_t::max());
+  if (min_last_update_acceptable == eversion_t::max())
+    return infos.end();
 
   map<pg_shard_t, pg_info_t>::const_iterator best = infos.end();
   // find osd with newest last_update (oldest for ec_pool).