]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix peer no missing optimization
authorSage Weil <sage@newdream.net>
Thu, 10 Mar 2011 18:17:24 +0000 (10:17 -0800)
committerSage Weil <sage@newdream.net>
Thu, 10 Mar 2011 18:17:24 +0000 (10:17 -0800)
This shortcut was broken: we need to populate peer_missing with missing
objects in terms of the master log, not the peer's log (which may be old
or even divergent).  This shortcut _only_ makes sense when the peer has
no missing in terms of a log that is perfectly up to date (i.e. matches
our last_update).

Reported-by: Henry Chang <henry.cy.chang@gmail.com>
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/osd/PG.cc

index d3f09a201845b1c8108ae3290d599317be08cef4..cbfcbbcbead2b7cdf872b0c19bc8137560eedeff 100644 (file)
@@ -1634,8 +1634,11 @@ void PG::do_peer(ObjectStore::Transaction& t, list<Context*>& tfin,
     if (pi.is_empty())
       continue;
     if (peer_missing.find(peer) == peer_missing.end()) {
-      if (pi.last_update == pi.last_complete) {
-       dout(10) << " infering no missing (last_update==last_complete) for osd" << peer << dendl;
+      if (pi.last_update == pi.last_complete &&  // peer has no missing
+         pi.last_update == info.last_update) {  // peer is up to date
+       // replica has no missing and identical log as us.  no need to
+       // pull anything.
+       dout(10) << " infering up to date and no missing (last_update==last_complete) for osd" << peer << dendl;
        peer_missing[peer].num_missing();  // just create the entry.
        search_for_missing(peer_info[peer], &peer_missing[peer], peer);
        continue;