]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
paxos: fix store_state fix
authorSage Weil <sage@newdream.net>
Fri, 28 May 2010 20:21:19 +0000 (13:21 -0700)
committerSage Weil <sage@newdream.net>
Fri, 28 May 2010 20:21:19 +0000 (13:21 -0700)
src/mon/Paxos.cc

index e569f0d6255cbe64eba32371abb14f9249a57c60..d10f31cbe8d9aaeeed938f840139b1f78726da57 100644 (file)
@@ -206,7 +206,7 @@ void Paxos::store_state(MMonPaxos *m)
   }
 
   for (map<version_t,bufferlist>::iterator p = m->values.begin();
-       p->first <= m->last_committed;
+       p != m->values.end() && p->first <= m->last_committed;
        ++p) {
     if (p->first <= last_committed)
       continue;
@@ -489,6 +489,7 @@ void Paxos::commit()
     MMonPaxos *commit = new MMonPaxos(mon->get_epoch(), MMonPaxos::OP_COMMIT, machine_id);
     commit->values[last_committed] = new_value;
     commit->pn = accepted_pn;
+    commit->last_committed = last_committed;
     
     mon->messenger->send_message(commit, mon->monmap->get_inst(*p));
   }