From: Igor Fedotov Date: Fri, 3 Feb 2023 10:58:25 +0000 (+0300) Subject: os/bluestore: bring spillover alerts back after regression. X-Git-Tag: v18.1.0~14^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=804b4fa5ca8681ea9cf6892b528939239a1c1cd9;p=ceph.git os/bluestore: bring spillover alerts back after regression. Fixes: https://tracker.ceph.com/issues/58440 Signed-off-by: Igor Fedotov (cherry picked from commit 4f20521faee3599dd897ecca9b32f5a4941b9709) --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index ce15862949a0..fd7ebd89fde5 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -17691,6 +17691,19 @@ void BlueStore::_record_onode(OnodeRef& o, KeyValueDB::Transaction &txn) void BlueStore::_log_alerts(osd_alert_list_t& alerts) { std::lock_guard l(qlock); + size_t used = bluefs && bluefs_layout.shared_bdev == BlueFS::BDEV_SLOW ? + bluefs->get_used(BlueFS::BDEV_SLOW) : 0; + if (used > 0) { + auto db_used = bluefs->get_used(BlueFS::BDEV_DB); + auto db_total = bluefs->get_total(BlueFS::BDEV_DB); + ostringstream ss; + ss << "spilled over " << byte_u_t(used) + << " metadata from 'db' device (" << byte_u_t(db_used) + << " used of " << byte_u_t(db_total) << ") to slow device"; + spillover_alert = ss.str(); + } else if (!spillover_alert.empty()){ + spillover_alert.clear(); + } if (!spurious_read_errors_alert.empty() && cct->_conf->bluestore_warn_on_spurious_read_errors) { diff --git a/src/os/bluestore/BlueStore.h b/src/os/bluestore/BlueStore.h index a0e8f324c082..c3d014dc9380 100644 --- a/src/os/bluestore/BlueStore.h +++ b/src/os/bluestore/BlueStore.h @@ -3360,15 +3360,6 @@ private: failed_cmode.clear(); } - void _set_spillover_alert(const std::string& s) { - std::lock_guard l(qlock); - spillover_alert = s; - } - void _clear_spillover_alert() { - std::lock_guard l(qlock); - spillover_alert.clear(); - } - void _check_legacy_statfs_alert(); void _check_no_per_pg_or_pool_omap_alert(); void _set_disk_size_mismatch_alert(const std::string& s) {