From 22f389d99a7432d4c02e2b7996e5f70b91215d55 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 28 Apr 2009 16:44:12 -0700 Subject: [PATCH] osd: clean up assemble_backlog --- src/osd/PG.cc | 11 ++++++----- src/osd/PG.h | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 3450c0dc48261..b84f770ca8f12 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -612,17 +612,18 @@ void PG::assemble_backlog(map& omap) assert(!le->is_delete()); // if it's a deletion, we are corrupt.. // note the prior version - be.version = le->prior_version; - if (be.version == eversion_t() || // either new object, or - be.version >= log.bottom) { // prior_version also already in log + if (le->prior_version == eversion_t() || // either new object, or + le->prior_version >= log.bottom) { // prior_version also already in log dout(15) << " skipping " << be << " (have " << *le << ")" << dendl; continue; // already have it logged. } - dout(15) << " adding" << be << " (have " << *le << ")" << dendl; + be.version = le->prior_version; + dout(15) << " adding " << be << " (have " << *le << ")" << dendl; log.log.push_front(be); + // don't try to index: this is the prior_version backlog entry } else { - dout(15) << " adding" << be << dendl; + dout(15) << " adding " << be << dendl; log.log.push_front(be); log.index( *log.log.begin() ); } diff --git a/src/osd/PG.h b/src/osd/PG.h index b4ca4f0b2dc68..49af482238951 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -886,7 +886,7 @@ inline ostream& operator<<(ostream& out, const PG::Info& pgi) inline ostream& operator<<(ostream& out, const PG::Log::Entry& e) { - return out << " " << e.version << " (" << e.prior_version << ")" + return out << e.version << " (" << e.prior_version << ")" << (e.is_delete() ? " - ": (e.is_clone() ? " c ": (e.is_modify() ? " m ": -- 2.39.5