From: zjh Date: Fri, 26 Apr 2019 07:15:11 +0000 (+0800) Subject: osd: Better error message when OSD count is less than osd_pool_default_size X-Git-Tag: v15.1.0~2607^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=94237d36932b27961afffbe65d433af26c3fe513;p=ceph.git osd: Better error message when OSD count is less than osd_pool_default_size Fixes: http://tracker.ceph.com/issues/38617 Signed-off-by: zjh --- diff --git a/doc/rados/operations/health-checks.rst b/doc/rados/operations/health-checks.rst index c75adaeddfe6..192e02e7797a 100644 --- a/doc/rados/operations/health-checks.rst +++ b/doc/rados/operations/health-checks.rst @@ -673,6 +673,12 @@ the pool is too large and should be reduced or set to zero with:: For more information, see :ref:`specifying_pool_target_size`. +TOO_FEW_OSDS +____________ + +The number of OSDs in the cluster is below the configurable +threshold of ``osd_pool_default_size``. + SMALLER_PGP_NUM _______________ diff --git a/src/mon/PGMap.cc b/src/mon/PGMap.cc index aa24d7f9746f..d3caa7c58d78 100644 --- a/src/mon/PGMap.cc +++ b/src/mon/PGMap.cc @@ -2692,6 +2692,15 @@ void PGMap::get_health_checks( } } + // TOO_FEW_OSDS + auto osd_pool_default_size = cct->_conf.get_val("osd_pool_default_size"); + if (osdmap.get_num_osds() < osd_pool_default_size) { + ostringstream ss; + ss << "OSD count " << osdmap.get_num_osds() + << " < osd_pool_default_size " << osd_pool_default_size; + checks->add("TOO_FEW_OSDS", HEALTH_WARN, ss.str()); + } + // SMALLER_PGP_NUM // MANY_OBJECTS_PER_PG if (!pg_stat.empty()) {