From: Sage Weil Date: Sun, 21 Jul 2013 15:11:22 +0000 (-0700) Subject: mon/Paxos: only learn uncommitted value if it is in the future X-Git-Tag: v0.61.7~14 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f598245f1355d7791162c03d90bdd97b013e56f3;p=ceph.git mon/Paxos: only learn uncommitted value if it is in the future If an older peer sends an uncommitted value, make sure we only take it if it is in the future, and at least as new as any current uncommitted value. (Prior to the previous patch, peers could send values from long-past rounds. The pn values are also bogus.) Signed-off-by: Sage Weil (cherry picked from commit b3253a453c057914753846c77499f98d3845c58e) --- diff --git a/src/mon/Paxos.cc b/src/mon/Paxos.cc index b52986cf401c..5a9cd841c0e1 100644 --- a/src/mon/Paxos.cc +++ b/src/mon/Paxos.cc @@ -393,7 +393,9 @@ void Paxos::handle_last(MMonPaxos *last) // did this person send back an accepted but uncommitted value? if (last->uncommitted_pn && - last->uncommitted_pn > uncommitted_pn) { + last->uncommitted_pn > uncommitted_pn && + last->last_committed >= last_committed && + last->last_committed + 1 >= uncommitted_v) { uncommitted_v = last->last_committed+1; uncommitted_pn = last->uncommitted_pn; uncommitted_value = last->values[uncommitted_v];