mon/OSDMonitor: fix initial map when require_luminous_osds not set on mkfs

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>
This commit is contained in:
Sage Weil 2017-04-11 22:35:32 -04:00
parent 10ea8e1d7d
commit 20e5bff7fc

View 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,