]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/Paxos: bootstrap peon too if monmap updates
authorSage Weil <sage@inktank.com>
Fri, 12 Jul 2013 21:27:04 +0000 (14:27 -0700)
committerSage Weil <sage@inktank.com>
Sat, 13 Jul 2013 20:00:19 +0000 (13:00 -0700)
If we get a monmap update, the leader bootstraps.  Peons should do the
same.

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

index 7779360ca33e2ae9290a17071a2d3ea42406ff55..d988c6415476a97b7ebd6c720d14caf4d41f9afc 100644 (file)
@@ -715,7 +715,13 @@ void Paxos::handle_commit(MMonPaxos *commit)
 
   commit->put();
 
-  mon->refresh_from_paxos(NULL);
+  bool need_bootstrap = false;
+  mon->refresh_from_paxos(&need_bootstrap);
+  if (need_bootstrap) {
+    dout(10) << " doing requested bootstrap" << dendl;
+    mon->bootstrap();
+    return;
+  }
 
   finish_contexts(g_ceph_context, waiting_for_commit);
 }