]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: add LARGE_CRUSH_BUCKET heath warning dvanders_large_crush_buckets 64055/head
authorDan van der Ster <dan.vanderster@clyso.com>
Fri, 20 Jun 2025 00:58:29 +0000 (17:58 -0700)
committerDan van der Ster <dan.vanderster@clyso.com>
Fri, 20 Jun 2025 20:31:23 +0000 (13:31 -0700)
Signed-off-by: Dan van der Ster <dan.vanderster@clyso.com>
src/common/options/mon.yaml.in
src/mon/PGMap.cc

index 2c337fcea70721b73abd548bb9657fcd15300bb1..49765cdfd174ac1b0c25a4a9f1d85c7df6fc04ec 100644 (file)
@@ -1412,4 +1412,13 @@ options:
   - mon
   flags:
   - runtime
\ No newline at end of file
+- name: mon_warn_on_large_crush_bucket
+  type: bool
+  level: advanced
+  desc: Raise a LARGE_CRUSH_BUCKET health check warning if any CRUSH bucket
+    nears the maximum weight of 65535.
+  default: true
+  services:
+  - mon
+  flags:
+  - runtime
index 07304cfcd8e64f297ca454ddd56d142bfc7ebe15..cb2d12a4f814117ee77e6f944764db9dce727925 100644 (file)
@@ -3490,6 +3490,21 @@ void PGMap::get_health_checks(
       d.detail.swap(detail);
     }
   }
+
+  // LARGE_CRUSH_BUCKET
+  if (g_conf().get_val<bool>("mon_warn_on_large_crush_bucket")) {
+    for (int b = 0; b < osdmap.crush->get_max_buckets(); ++b) {
+      int bid = -1 - b;
+      if (osdmap.crush->bucket_exists(bid) &&
+          osdmap.crush->get_bucket_weightf(bid) > 60000.0) {
+        ostringstream ss;
+        ss << "CRUSH bucket " << osdmap.crush->get_item_name(bid)
+           << " is nearing the maximum weight of 65535";
+        auto& d = checks->add("LARGE_CRUSH_BUCKET", HEALTH_WARN, ss.str(), 1);
+        d.detail.push_back("use a smaller osd_crush_scaling_factor before adding more OSDs");
+      }
+    }
+  }
 }
 
 void PGMap::print_summary(ceph::Formatter *f, ostream *out) const