]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon/OSDMonitor: fix initial map when require_luminous_osds not set on mkfs
authorSage Weil <sage@redhat.com>
Wed, 12 Apr 2017 02:35:32 +0000 (22:35 -0400)
committerSage Weil <sage@redhat.com>
Thu, 13 Apr 2017 14:10:26 +0000 (10:10 -0400)
If we don't set the luminous flag, we should not set the new luninous
fields or else we'll get a crc mismatch.  (Funnily that happens in the
epoch where the flag is eventually set and the encoded map finally includes
the field we have set in memory.)

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

index 9731e73e692bba5b835cd71e53b25df11930ab49..473a64a1e03bff97755bb2c68a263e0f685934c1 100644 (file)
@@ -159,11 +159,11 @@ void OSDMonitor::create_initial()
   // new cluster should require latest by default
   newmap.set_flag(CEPH_OSDMAP_REQUIRE_JEWEL);
   newmap.set_flag(CEPH_OSDMAP_REQUIRE_KRAKEN);
-  if (!g_conf->mon_debug_no_require_luminous)
+  if (!g_conf->mon_debug_no_require_luminous) {
     newmap.set_flag(CEPH_OSDMAP_REQUIRE_LUMINOUS);
-
-  newmap.full_ratio = g_conf->mon_osd_full_ratio;
-  newmap.nearfull_ratio = g_conf->mon_osd_nearfull_ratio;
+    newmap.full_ratio = g_conf->mon_osd_full_ratio;
+    newmap.nearfull_ratio = g_conf->mon_osd_nearfull_ratio;
+  }
 
   // encode into pending incremental
   newmap.encode(pending_inc.fullmap,