]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon/OSDMonitor: avoid pulling pgmap ratio on mkfs
authorSage Weil <sage@redhat.com>
Sat, 13 May 2017 02:40:22 +0000 (21:40 -0500)
committerSage Weil <sage@redhat.com>
Fri, 2 Jun 2017 17:02:08 +0000 (13:02 -0400)
If this is the first osdmap epoch there is nothing to be learned from
the PGMap.

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

index b07cf59d4a41a4c4acb5c9bd1ea53986febc3110..6f736373aaafac391936f58c3cc70bc9ac69cbbd 100644 (file)
@@ -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());