]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Better error message when OSD count is less than osd_pool_default_size
authorzjh <jhzeng93@foxmail.com>
Fri, 26 Apr 2019 07:15:11 +0000 (15:15 +0800)
committerzjh <jhzeng93@foxmail.com>
Sun, 28 Apr 2019 12:09:13 +0000 (20:09 +0800)
Fixes: http://tracker.ceph.com/issues/38617
Signed-off-by: zjh <jhzeng93@foxmail.com>
doc/rados/operations/health-checks.rst
src/mon/PGMap.cc

index c75adaeddfe648ea4afdd2e0c8d3df94edc80855..192e02e7797adfdd416492904a895ee036aa7186 100644 (file)
@@ -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
 _______________
 
index aa24d7f9746fc22cf72123770af4c829b24d3ff5..d3caa7c58d7875a84228eb7349f682b7d44d1f4b 100644 (file)
@@ -2692,6 +2692,15 @@ void PGMap::get_health_checks(
     }
   }
 
+  // TOO_FEW_OSDS
+  auto osd_pool_default_size = cct->_conf.get_val<uint64_t>("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()) {