]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon/Monitor: use legacy ranks during bootstrap for initial seed monmap
authorSage Weil <sage@redhat.com>
Mon, 28 May 2018 18:50:48 +0000 (13:50 -0500)
committerSage Weil <sage@redhat.com>
Mon, 28 May 2018 18:50:48 +0000 (13:50 -0500)
We get various fabricated monmaps with epoch 0 to get things started.  Use
the legacy rank order so that we have a well-defined ordering and mon
ranks do not collide.

Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/Monitor.cc

index 2a8df86004e1f8861b4cfccd07c83d523786c141..5b7a18bd20d29e7528f84c0f2ac2119a156713eb 100644 (file)
@@ -1005,6 +1005,12 @@ void Monitor::bootstrap()
   unregister_cluster_logger();
   cancel_probe_timeout();
 
+  if (monmap->get_epoch() == 0) {
+    dout(10) << "reverting to legacy ranks for seed monmap (epoch 0)" << dendl;
+    monmap->calc_legacy_ranks();
+  }
+  dout(10) << "monmap " << *monmap << dendl;
+
   // note my rank
   int newrank = monmap->get_rank(messenger->get_myaddr());
   if (newrank < 0 && rank >= 0) {