]> git.apps.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)
committerNathan Cutler <ncutler@suse.com>
Sat, 7 Sep 2019 09:59:06 +0000 (11:59 +0200)
Fixes: http://tracker.ceph.com/issues/38617
Signed-off-by: zjh <jhzeng93@foxmail.com>
(cherry picked from commit 94237d36932b27961afffbe65d433af26c3fe513)

Conflicts:
doc/rados/operations/health-checks.rst
- trivial
        src/mon/PGMap.cc
- cct->_conf->get_val in mimic

doc/rados/operations/health-checks.rst
src/mon/PGMap.cc

index be306e3a977d8adba66361291951dd5b92309c18..d7e4a915557572fbf5f5e81937e9936c18acbf61 100644 (file)
@@ -385,6 +385,12 @@ so marking "out" OSDs "in" (if there are any) can also help::
 Please refer to :ref:`choosing-number-of-placement-groups` for more
 information.
 
+TOO_FEW_OSDS
+____________
+
+The number of OSDs in the cluster is below the configurable
+threshold of ``osd_pool_default_size``.
+
 SMALLER_PGP_NUM
 _______________
 
index 9b39f32888b03295b08983171b7d826956115c08..b7156c0e81ef8f844cababb08f2c51293620599f 100644 (file)
@@ -2569,6 +2569,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()) {