diff options
author | Samuel Just <sam.just@inktank.com> | 2013-02-22 14:12:28 -0800 |
---|---|---|
committer | Samuel Just <sam.just@inktank.com> | 2013-02-22 14:19:55 -0800 |
commit | 2dae6a68ee85a20220ee940dbe33a2144d43457b (patch) | |
tree | a8f0251ad8158ca246e8e3c800a32832c25d7fed | |
parent | e4fd70fcec3a9abb7f19517326e46f58031c4196 (diff) | |
download | ceph-2dae6a68ee85a20220ee940dbe33a2144d43457b.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>
-rw-r--r-- | src/osd/PG.cc | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 12701f98638..9974ee082dd 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -275,10 +275,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; |