]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/Paxos: only share uncommitted value if it is next
authorSage Weil <sage@inktank.com>
Mon, 22 Jul 2013 21:13:23 +0000 (14:13 -0700)
committerSage Weil <sage@inktank.com>
Mon, 22 Jul 2013 21:13:23 +0000 (14:13 -0700)
We may have an uncommitted value from our perspective (it is our lc + 1)
when the collector has a much larger lc (because we have been out for
the last few rounds).  Only share an uncommitted value if it is in fact
the next value.

Signed-off-by: Sage Weil <sage@inktank.com>
src/mon/Paxos.cc

index ee2ba3b6fdb893e3d5bd401d5c9e0e58c6391bef..7785d37d4f03bf2fa35034862500c8dacc5d0750 100644 (file)
@@ -198,7 +198,8 @@ void Paxos::handle_collect(MMonPaxos *collect)
   // do we have an accepted but uncommitted value?
   //  (it'll be at last_committed+1)
   bufferlist bl;
-  if (get_store()->exists(get_name(), last_committed+1)) {
+  if (collect->last_committed == last_committed &&
+      get_store()->exists(get_name(), last_committed+1)) {
     get_store()->get(get_name(), last_committed+1, bl);
     assert(bl.length() > 0);
     dout(10) << " sharing our accepted but uncommitted value for "