]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: remove the last_consumed setting in Paxos
authorGreg Farnum <gregory.farnum@dreamhost.com>
Fri, 10 Feb 2012 23:07:10 +0000 (15:07 -0800)
committerGreg Farnum <gregory.farnum@dreamhost.com>
Fri, 10 Feb 2012 23:07:10 +0000 (15:07 -0800)
This was only ever used while initializing the Paxos machine, and it
doesn't need to be. Its existence is just an invitation to have races
between updating the stashed data and the stashed version.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
src/mon/Paxos.cc

index f9b49b86e3a667f0f003f609b8fab16137d3a4c4..94064e3baaa6a8c1f32ac56bf7d101043b386f55 100644 (file)
@@ -43,7 +43,8 @@ void Paxos::init()
   accepted_pn = mon->store->get_int(machine_name, "accepted_pn");
   last_committed = mon->store->get_int(machine_name, "last_committed");
   first_committed = mon->store->get_int(machine_name, "first_committed");
-  latest_stashed = mon->store->get_int(machine_name, "last_consumed");
+  bufferlist temp;
+  latest_stashed = get_stashed(temp);
   slurping = mon->store->get_int(machine_name, "slurping");
 
   dout(10) << "init" << dendl;
@@ -1043,7 +1044,6 @@ void Paxos::stash_latest(version_t v, bufferlist& bl)
   
   dout(10) << "stash_latest v" << v << " len " << bl.length() << dendl;
   mon->store->put_bl_ss(final, machine_name, "latest");
-  mon->store->put_int(v, machine_name, "last_consumed");
 
   latest_stashed = v;
 }