mon: fix off-by-one: no need to reapply previous last_committed after sync

The old last_committed is already committed; don't reapply. This also fixes
the case where lc was 0 (i.e., we did get_cookie_recent from the beginning
of time).

Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
Sage Weil 2013-07-11 17:45:46 -07:00
parent e213b1bc25
commit e019dd0497

View File

@ -1144,7 +1144,7 @@ void Monitor::handle_sync_chunk(MMonSync *m)
if (!sync_full) {
dout(10) << __func__ << " applying recent paxos transactions as we go" << dendl;
MonitorDBStore::Transaction tx;
paxos->read_and_prepare_transactions(&tx, paxos->get_version(), m->last_committed);
paxos->read_and_prepare_transactions(&tx, paxos->get_version() + 1, m->last_committed);
tx.put(paxos->get_name(), "last_committed", m->last_committed);
dout(30) << __func__ << " tx dump:\n";