]> 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)
committerNathan Cutler <ncutler@suse.com>
Wed, 16 Oct 2019 09:58:29 +0000 (11:58 +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 luminous

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

index e261be1948444eb695d30ae7c23afef5745ac9f3..aa4ba460f73f1a570da6cd06d032bf9200eafc84 100644 (file)
@@ -408,6 +408,12 @@ Please refer to
 :doc:`placement-groups#Choosing-the-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 31a3e975a5413bb3c8d0d48f952bbcc912f845af..1a005b24da5b3652eb5ec8c54ce2b55dcdd9b39e 100644 (file)
@@ -3013,6 +3013,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()) {