From 4c97cb5f347a8b8529cd1aad680cea705682e35a Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 20 May 2011 00:14:24 -0700 Subject: [PATCH] osd: fix compensation for bad last_complete 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 --- src/osd/PG.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 9f020fd5a2ed3..aa496c3cef9e4 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -1602,7 +1602,7 @@ void PG::activate(ObjectStore::Transaction& t, list& 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 { -- 2.39.5