From 2fdec7b84eb2b377268fe156f4c4a45cf9d01e97 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sun, 16 Oct 2011 20:37:28 -0700 Subject: [PATCH] osd: fix add_next_event Missing::item::have The missing set should be accurate up to the current point in the log. The log_tail has no bearing on that, nor does last_update, since we're processing new events in forward order, and updating missing as we go. Drops the now unused info argument... :/ This more or less reverts b418896d. Signed-off-by: Sage Weil --- src/osd/PG.cc | 14 ++++++-------- src/osd/PG.h | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index cf8c127436959..ccc60f32ec574 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -431,7 +431,7 @@ void PG::merge_log(ObjectStore::Transaction& t, for (; p != log.log.end(); p++) { Log::Entry &ne = *p; dout(20) << "merge_log merging " << ne << dendl; - missing.add_next_event(ne, oinfo); + missing.add_next_event(ne); if (ne.is_delete()) t.remove(coll, ne.soid); } @@ -522,7 +522,7 @@ void PG::merge_log(ObjectStore::Transaction& t, Log::Entry &ne = *p; dout(20) << "merge_log " << ne << dendl; log.index(ne); - missing.add_next_event(ne, info); + missing.add_next_event(ne); if (ne.is_delete()) t.remove(coll, ne.soid); } @@ -1561,7 +1561,7 @@ void PG::activate(ObjectStore::Transaction& t, list& tfin, p != m->log.log.end(); p++) if (p->version > plu) - pm.add_next_event(*p, pi); + pm.add_next_event(*p); } if (m) { @@ -3348,7 +3348,7 @@ void PG::share_pg_log() for (list::const_iterator i = m->log.log.begin(); i != m->log.log.end(); ++i) { - pmissing.add_next_event(*i, pinfo); + pmissing.add_next_event(*i); } pinfo.last_update = m->log.head; @@ -3679,7 +3679,7 @@ eversion_t PG::Missing::have_old(const hobject_t& oid) const * this needs to be called in log order as we extend the log. it * assumes missing is accurate up through the previous log entry. */ -void PG::Missing::add_next_event(const Log::Entry& e, const Info &info) +void PG::Missing::add_next_event(const Log::Entry& e) { if (e.is_update()) { if (e.prior_version == eversion_t()) { @@ -3693,9 +3693,7 @@ void PG::Missing::add_next_event(const Log::Entry& e, const Info &info) //assert(missing[e.soid].need == e.prior_version); rmissing.erase(missing[e.soid].need.version); missing[e.soid].need = e.version; // leave .have unchanged. - } else if (e.is_backlog() || - e.prior_version <= info.log_tail || - e.prior_version > info.last_update) { + } else if (e.is_backlog()) { // May not have prior version missing[e.soid].need = e.version; } else { diff --git a/src/osd/PG.h b/src/osd/PG.h index 830b8a5f9af7a..6d744613bdc53 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -713,7 +713,7 @@ public: bool is_missing(const hobject_t& oid) const; bool is_missing(const hobject_t& oid, eversion_t v) const; eversion_t have_old(const hobject_t& oid) const; - void add_next_event(const Log::Entry& e, const Info &info); + void add_next_event(const Log::Entry& e); void revise_need(hobject_t oid, eversion_t need); void add(const hobject_t& oid, eversion_t need, eversion_t have); void rm(const hobject_t& oid, eversion_t v); -- 2.39.5