]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: do not use incomplete peer for best info/log
authorSage Weil <sage.weil@dreamhost.com>
Sun, 1 Jan 2012 04:44:05 +0000 (20:44 -0800)
committerSage Weil <sage@newdream.net>
Wed, 4 Jan 2012 21:59:26 +0000 (13:59 -0800)
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 <sage.weil@dreamhost.com>
src/osd/PG.cc

index 8cbf800d8493247c04383af6795c199e67735c35..6ad7cd62ed57449089c9723186039970a510708d 100644 (file)
@@ -894,6 +894,9 @@ map<int, PG::Info>::const_iterator PG::find_best_info(const map<int, Info> &info
   for (map<int, Info>::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;