]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix compensation for bad last_complete
authorSage Weil <sage.weil@dreamhost.com>
Fri, 20 May 2011 07:14:24 +0000 (00:14 -0700)
committerSage Weil <sage.weil@dreamhost.com>
Fri, 20 May 2011 07:14:24 +0000 (00:14 -0700)
If the peer has a last_complete below their tail, we can get by with our
log (without backlog) if our tail if _before_ their last_complete, not
after.  Otherwise, we need a backlog!

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/osd/PG.cc

index 9f020fd5a2ed353ebdd721ca2fcd03534324c545..aa496c3cef9e4253950178c02d9827b845faeae1 100644 (file)
@@ -1602,7 +1602,7 @@ void PG::activate(ObjectStore::Transaction& t, list<Context*>& tfin,
          // the replica's tail is after it's last_complete and it has no backlog.
          // ick, this shouldn't normally happen.  but we can compensate!
          dout(10) << "activate peer osd" << peer << " has last_complete < log tail and no backlog, compensating" << dendl;
-         if (log.tail >= pi.last_complete) {
+         if (log.tail <= pi.last_complete) {
            // _our_ log is sufficient, phew!
            m->log.copy_after(log, pi.last_complete);
          } else {