From: Sage Weil Date: Tue, 23 Jun 2009 04:32:09 +0000 (-0700) Subject: osd: stop rewinding replica log when we reach log.bottom X-Git-Tag: v0.10~173 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=89eb728f14ebbf0994b08b9e8da3e33d4a67dcf9;p=ceph.git osd: stop rewinding replica log when we reach log.bottom 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. --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 6c58e35d4cc4..be3a09bd05e1 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -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;