From: Joao Eduardo Luis Date: Mon, 11 Mar 2013 16:25:35 +0000 (+0000) Subject: mon: Paxos: bootstrap leader if he has fallen behind upon reaching collect X-Git-Tag: v0.59~21 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=41987f380f4fc72762486ad7ddd0ab63173dc5e3;p=ceph.git mon: Paxos: bootstrap leader if he has fallen behind upon reaching collect Fixes: #4256 Signed-off-by: Joao Eduardo Luis Reviewed-by: Sage Weil --- diff --git a/src/mon/Paxos.cc b/src/mon/Paxos.cc index e8c0ca9342c..53476f8a67e 100644 --- a/src/mon/Paxos.cc +++ b/src/mon/Paxos.cc @@ -164,7 +164,7 @@ void Paxos::handle_collect(MMonPaxos *collect) if (collect->first_committed > last_committed+1) { dout(5) << __func__ << " leader's lowest version is too high for our last committed" - << "(theirs: " << collect->first_committed + << " (theirs: " << collect->first_committed << "; ours: " << last_committed << ") -- bootstrap!" << dendl; collect->put(); mon->bootstrap(); @@ -366,9 +366,19 @@ void Paxos::handle_last(MMonPaxos *last) // push it to them. peer_last_committed[last->get_source().num()] = last->last_committed; + if (last->first_committed > last_committed+1) { + dout(5) << __func__ + << " peon's lowest version is too high for our last committed" + << " (theirs: " << last->first_committed + << "; ours: " << last_committed << ") -- bootstrap!" << dendl; + last->put(); + mon->bootstrap(); + return; + } + // store any committed values if any are specified in the message store_state(last); - + // do they accept your pn? if (last->pn > accepted_pn) { // no, try again.