]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: fix off-by-one: no need to reapply previous last_committed after sync
authorSage Weil <sage@inktank.com>
Fri, 12 Jul 2013 00:45:46 +0000 (17:45 -0700)
committerSage Weil <sage@inktank.com>
Fri, 12 Jul 2013 18:12:59 +0000 (11:12 -0700)
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>
src/mon/Monitor.cc

index a1959a08c89ea9113f9c0e0ba29b65dfc436f1e2..211b1a5d0cebb9f0018f4e955faf0e740151821f 100644 (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";