]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: Paxos: bootstrap leader if he has fallen behind upon reaching collect
authorJoao Eduardo Luis <joao.luis@inktank.com>
Mon, 11 Mar 2013 16:25:35 +0000 (16:25 +0000)
committerSage Weil <sage@inktank.com>
Mon, 11 Mar 2013 19:50:24 +0000 (12:50 -0700)
Fixes: #4256
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
src/mon/Paxos.cc

index e8c0ca9342c83831b0af4c25550d9e422c92a803..53476f8a67eda99a3d1870e0fe12ad80c8de9b4f 100644 (file)
@@ -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.