]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/PGMap: adjust SMALLER_PGP_NUM warning to use *_target values
authorSage Weil <sage@redhat.com>
Sun, 8 Apr 2018 18:30:41 +0000 (13:30 -0500)
committerSage Weil <sage@redhat.com>
Fri, 7 Sep 2018 17:08:40 +0000 (12:08 -0500)
If the cluster is failing to converge on the target values that is a
separate problem.

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

index e89494058bbfa6a38560479dd611e0936125a778..6dd2e697f371bb7aeaa003fbfcf672ec464ae7f9 100644 (file)
@@ -2577,19 +2577,24 @@ void PGMap::get_health_checks(
       if (!pi)
        continue;   // in case osdmap changes haven't propagated to PGMap yet
       const string& name = osdmap.get_pool_name(p->first);
-      if (pi->get_pg_num() > pi->get_pgp_num() &&
+      // NOTE: we use pg_num_target and pgp_num_target for the purposes of
+      // the warnings.  If the cluster is failing to converge on the target
+      // values that is a separate issue!
+      if (pi->get_pg_num_target() > pi->get_pgp_num_target() &&
          !(name.find(".DELETED") != string::npos &&
            cct->_conf->mon_fake_pool_delete)) {
        ostringstream ss;
        ss << "pool " << name << " pg_num "
-          << pi->get_pg_num() << " > pgp_num " << pi->get_pgp_num();
+          << pi->get_pg_num_target()
+          << " > pgp_num " << pi->get_pgp_num_target();
        pgp_detail.push_back(ss.str());
       }
       int average_objects_per_pg = pg_sum.stats.sum.num_objects / pg_stat.size();
       if (average_objects_per_pg > 0 &&
           pg_sum.stats.sum.num_objects >= mon_pg_warn_min_objects &&
           p->second.stats.sum.num_objects >= mon_pg_warn_min_pool_objects) {
-       int objects_per_pg = p->second.stats.sum.num_objects / pi->get_pg_num();
+       int objects_per_pg = p->second.stats.sum.num_objects /
+         pi->get_pg_num_target();
        float ratio = (float)objects_per_pg / (float)average_objects_per_pg;
        if (mon_pg_warn_max_object_skew > 0 &&
            ratio > mon_pg_warn_max_object_skew) {