]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: Paxos: bootstrap if we have fallen behind when we start collecting
authorJoao Eduardo Luis <joao.luis@inktank.com>
Tue, 26 Feb 2013 01:54:10 +0000 (01:54 +0000)
committerJoao Eduardo Luis <joao.luis@inktank.com>
Tue, 26 Feb 2013 23:47:09 +0000 (23:47 +0000)
Fixes: #4256
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
src/mon/Paxos.cc

index d0a716a6e46d9f2de433f431b1cafff89a9ace07..9a47ec946d6c0f353afa14fa26605b41b97d75e6 100644 (file)
@@ -161,6 +161,16 @@ void Paxos::handle_collect(MMonPaxos *collect)
   // we're recoverying, it seems!
   state = STATE_RECOVERING;
 
+  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
+            << "; ours: " << last_committed << ") -- bootstrap!" << dendl;
+    collect->put();
+    mon->bootstrap();
+    return;
+  }
+
   // reply
   MMonPaxos *last = new MMonPaxos(mon->get_epoch(), MMonPaxos::OP_LAST,
                                  ceph_clock_now(g_ceph_context));