summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Just <sam.just@inktank.com>2013-02-22 14:12:28 -0800
committerSamuel Just <sam.just@inktank.com>2013-03-20 15:19:17 -0700
commitea570591b0d9dda102bece0f4cc7d263c3e2a3b0 (patch)
tree8dc3bcacbca39a47937aea072f3bcd2446ee4c1e
parentaa38d87c6237ccfb8b3b03bc7c28dcadb927237b (diff)
downloadceph-ea570591b0d9dda102bece0f4cc7d263c3e2a3b0.tar.gz
PG::proc_replica_log: oinfo.last_complete must be *before* first entry in omissing
Fixes: #4189 Signed-off-by: Samuel Just <sam.just@inktank.com> (cherry picked from commit 2dae6a68ee85a20220ee940dbe33a2144d43457b)
-rw-r--r--src/osd/PG.cc21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/osd/PG.cc b/src/osd/PG.cc
index e17ef639f40..60ec8e4f662 100644
--- a/src/osd/PG.cc
+++ b/src/osd/PG.cc
@@ -268,10 +268,23 @@ void PG::proc_replica_log(ObjectStore::Transaction& t,
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 (omissing.have_missing())
- oinfo.last_complete = omissing.missing[omissing.rmissing.begin()->second].need;
+ }
+
+ if (omissing.have_missing()) {
+ eversion_t first_missing =
+ omissing.missing[omissing.rmissing.begin()->second].need;
+ oinfo.last_complete = eversion_t();
+ list<pg_log_entry_t>::const_iterator i = olog.log.begin();
+ for (;
+ i != olog.log.end();
+ ++i) {
+ if (i->version < first_missing)
+ oinfo.last_complete = i->version;
+ else
+ break;
+ }
+ } else {
+ oinfo.last_complete = oinfo.last_update;
}
peer_info[from] = oinfo;