From: Sage Weil Date: Sat, 13 May 2017 02:40:22 +0000 (-0500) Subject: mon/OSDMonitor: avoid pulling pgmap ratio on mkfs X-Git-Tag: ses5-milestone6~8^2~19^2~99 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fb3405d0d355b827a5bee6e41293bfa0d0aab6df;p=ceph.git mon/OSDMonitor: avoid pulling pgmap ratio on mkfs If this is the first osdmap epoch there is nothing to be learned from the PGMap. Signed-off-by: Sage Weil --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index b07cf59d4a41..6f736373aaaf 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -887,7 +887,8 @@ void OSDMonitor::create_pending() dout(1) << __func__ << " setting backfillfull_ratio = " << pending_inc.new_backfillfull_ratio << dendl; } - if (osdmap.require_osd_release < CEPH_RELEASE_LUMINOUS) { + if (osdmap.get_epoch() > 0 && + osdmap.require_osd_release < CEPH_RELEASE_LUMINOUS) { // transition full ratios from PGMap to OSDMap (on upgrade) float full_ratio = mon->pgservice->get_full_ratio(); float nearfull_ratio = mon->pgservice->get_nearfull_ratio(); @@ -931,7 +932,8 @@ OSDMonitor::update_pending_pgs(const OSDMap::Incremental& inc) if (pending_creatings.last_scan_epoch > inc.epoch) { return pending_creatings; } - if (!osdmap.test_flag(CEPH_OSDMAP_REQUIRE_LUMINOUS)) { + if (osdmap.get_epoch() && + !osdmap.test_flag(CEPH_OSDMAP_REQUIRE_LUMINOUS)) { const unsigned total = pending_creatings.pgs.size(); mon->pgservice->maybe_add_creating_pgs(creating_pgs.last_scan_epoch, &pending_creatings); @@ -1294,7 +1296,8 @@ void OSDMonitor::encode_pending(MonitorDBStore::TransactionRef t) if (mon->monmap->get_required_features().contains_all( ceph::features::mon::FEATURE_LUMINOUS)) { auto pending_creatings = update_pending_pgs(pending_inc); - if (osdmap.require_osd_release < CEPH_RELEASE_LUMINOUS) { + if (osdmap.get_epoch() && + osdmap.require_osd_release < CEPH_RELEASE_LUMINOUS) { dout(7) << __func__ << " in the middle of upgrading, " << " trimming pending creating_pgs using pgmap" << dendl; trim_creating_pgs(&pending_creatings, *mon->pgservice->get_pg_stat());