From 4bcdb37cf3d187a8c96d8cf43dbae521b5a48cba Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sat, 31 Dec 2011 20:44:05 -0800 Subject: [PATCH] osd: do not use incomplete peer for best info/log For one, their stats are incomplete; if we use them we'll screw up everyone else. For another, it doesn't do us any good if they are a bit ahead of the peers: we/they may not even have the objects their newer log says were updated. The only real use is if their log extends farther back in time, but that is a problem in general that we'll eventually solve in other ways. On the other hand, having the pg_stats sum only through last_backfill may not have been the best choice; we could avoid that part of things by adding a objects_backfilled field. But this is probably a good idea anyway. Signed-off-by: Sage Weil --- src/osd/PG.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 8cbf800d84932..6ad7cd62ed574 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -894,6 +894,9 @@ map::const_iterator PG::find_best_info(const map &info for (map::const_iterator p = infos.begin(); p != infos.end(); ++p) { + // Disquality anyone who is incomplete (not fully backfilled) + if (p->second.is_incomplete()) + continue; if (best == infos.end()) { best = p; continue; -- 2.39.5