From 8f1e549c96a5c4bc308710e2fdd13419f5180b53 Mon Sep 17 00:00:00 2001 From: Indira Sawant Date: Tue, 27 Jan 2026 13:40:20 -0600 Subject: [PATCH] os/bluestore: add health warn for shared DB/WAL ratio BlueStore now emits a HEALTH_WARN alert when the BlueFS DB/WAL device, which shares the main device, exceeds 6% of the main device size. This helps administrators identify potentially oversized metadata that could impact performance. Changes include: - Added logic in BlueStore::_log_alerts() to check the shared DB/WAL size relative to the main device. - Introduced a new alert key "BLUESTORE_SHARED_DB_RATIO" for reporting via `ceph health detail`. - Updated the OSD health summary aggregation code to display a human- readable description of this alert. Fixes: https://tracker.ceph.com/issues/73826 Signed-off-by: Indira Sawant --- PendingReleaseNotes | 8 ++++++++ src/mon/PGMap.cc | 2 ++ src/os/bluestore/BlueStore.cc | 17 +++++++++++++++++ 3 files changed, 27 insertions(+) diff --git a/PendingReleaseNotes b/PendingReleaseNotes index 446297dad61..18d21fe4056 100644 --- a/PendingReleaseNotes +++ b/PendingReleaseNotes @@ -26,6 +26,14 @@ scan_extents, scan_inodes, and other state-changing operations. Related Tracker: https://tracker.ceph.com/issues/63191 +* OSD: A health warning is reported when BlueStore DB/WAL sizes are large relative + to the main OSD data device. + This warning is informational and does not impact OSD functionality, but highlights + uneven OSD utilization and cause some OSDs to reach *full states sooner + than others. Administrators may review and take action if needed. + Users can temporarily mute it with: + ``ceph health mute BLUESTORE_SHARED_DB_RATIO`` + >=20.0.0 * RADOS: The lead Monitor and stretch mode status are now displayed by `ceph status`. diff --git a/src/mon/PGMap.cc b/src/mon/PGMap.cc index 3a500d5f35f..071a85f1e48 100644 --- a/src/mon/PGMap.cc +++ b/src/mon/PGMap.cc @@ -3314,6 +3314,8 @@ void PGMap::get_health_checks( summary += " experiencing stalled read in block device of BlueStore"; } else if (asum.first == "WAL_DEVICE_STALLED_READ_ALERT") { summary += " experiencing stalled read in wal device of BlueFS"; + } else if (asum.first == "BLUESTORE_SHARED_DB_RATIO") { + summary += " have shared DB/WAL device exceeding 6% of main device size"; } else if (asum.first == "DB_DEVICE_STALLED_READ_ALERT") { summary += " experiencing stalled read in db device of BlueFS"; } else if (asum.first.find("_DISCARD_QUEUE") != std::string::npos) { diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 28ee6a4f87a..f57648b7e93 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -19274,6 +19274,23 @@ void BlueStore::_log_alerts(osd_alert_list_t& alerts) } else if (!spillover_alert.empty()){ spillover_alert.clear(); } + // CHECK: shared DB/WAL ratio with main device size + if (bluefs) { + uint64_t db_size = bluefs->get_block_device_size(BlueFS::BDEV_DB); + uint64_t block_size = bluefs->get_block_device_size(BlueFS::BDEV_SLOW); + + if (block_size > 0 && db_size >0) { + double ratio = static_cast(db_size) / static_cast(block_size); + if (ratio > 0.06) { + ostringstream ss; + ss << "BlueStore shared DB/WAL device (" << byte_u_t(db_size) + << ") exceeds 6% of main device (" << byte_u_t(block_size) + << ", " << std::fixed << std::setprecision(2) + << ratio * 100.0 << "%)"; + alerts.emplace("BLUESTORE_SHARED_DB_RATIO", ss.str()); + } + } + } if (cct->_conf->bluestore_slow_ops_warn_threshold) { size_t qsize = _trim_slow_op_event_queue(mono_clock::now()); if (qsize >= cct->_conf->bluestore_slow_ops_warn_threshold) { -- 2.47.3