From 07f54f28df7429a88dd9243800281ecf23f10036 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Mon, 15 Sep 2014 16:53:21 -0700 Subject: [PATCH] PG::find_best_info: let history.last_epoch_started provide a lower bound 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 --- src/osd/PG.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 2c86f3ba2d251..826b55939b503 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -867,6 +867,10 @@ map::const_iterator PG::find_best_info( for (map::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::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::const_iterator best = infos.end(); // find osd with newest last_update (oldest for ec_pool). -- 2.39.5