]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: stop rewinding replica log when we reach log.bottom
authorSage Weil <sage@newdream.net>
Tue, 23 Jun 2009 04:32:09 +0000 (21:32 -0700)
committerSage Weil <sage@newdream.net>
Tue, 23 Jun 2009 16:33:13 +0000 (09:33 -0700)
We stop rewinding a replica log when we reach our own
log.bottom, because we don't know enough to do so in any
meaningful way, and because we can assume it is not
divergent at that point (barring any complete screwupedness).

Also, if we do change last_update, make sure last_complete is
rewound too.

src/osd/PG.cc

index 6c58e35d4cc4001702b31efc9eb9f38eb2b4c850..be3a09bd05e1f78a820f1a7d15f3fdfcd2d0d0e8 100644 (file)
@@ -200,11 +200,16 @@ void PG::proc_replica_log(ObjectStore::Transaction& t, Info &oinfo, Log &olog, M
     eversion_t lu = oinfo.last_update;
     while (pp != olog.log.rend()) {
       Log::Entry& oe = *pp;
+
+      // don't continue past the bottom of our log.
+      if (oe.version < log.bottom)
+       break;
+
       if (!log.objects.count(oe.soid)) {
         dout(10) << " had " << oe << " new dne : divergent, ignoring" << dendl;
         ++pp;
         continue;
-      } 
+      }
       
       Log::Entry& ne = *log.objects[oe.soid];
       if (ne.version == oe.version) {
@@ -246,6 +251,8 @@ void PG::proc_replica_log(ObjectStore::Transaction& t, Info &oinfo, Log &olog, M
     if (lu < oinfo.last_update) {
       dout(10) << " peer osd" << from << " last_update now " << lu << dendl;
       oinfo.last_update = lu;
+      if (lu < oinfo.last_complete)
+       oinfo.last_complete = lu;
       if (lu < oldest_update) {
         dout(10) << " oldest_update now " << lu << dendl;
         oldest_update = lu;