From 4bea0efac02449066e0ec411aa273de7e8137d11 Mon Sep 17 00:00:00 2001 From: Jaya Prakash Date: Thu, 7 May 2026 12:09:07 +0000 Subject: [PATCH] common/options, os/bluestore: add debug option to force bluefs files onto slow device Fixes: https://tracker.ceph.com/issues/74319 Signed-off-by: Jaya Prakash --- src/common/options/global.yaml.in | 10 ++++++++++ src/os/bluestore/BlueFS.cc | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/src/common/options/global.yaml.in b/src/common/options/global.yaml.in index bcadaa1cdce..c67ee2996b1 100644 --- a/src/common/options/global.yaml.in +++ b/src/common/options/global.yaml.in @@ -4414,6 +4414,16 @@ options: flags: - runtime with_legacy: true +- name: bluefs_debug_force_slow + type: bool + level: dev + desc: For testing. Force BlueFS to allocate files on slow device. + long_desc: When enabled, the RocksDBBlueFSVolumeSelector will ignore normal + placement policy and redirect allocations to slow device. + default: false + flags: + - runtime + with_legacy: true - name: bluestore_bluefs type: bool level: dev diff --git a/src/os/bluestore/BlueFS.cc b/src/os/bluestore/BlueFS.cc index 04f7ebd4a52..809c1a3ca84 100644 --- a/src/os/bluestore/BlueFS.cc +++ b/src/os/bluestore/BlueFS.cc @@ -5745,6 +5745,11 @@ uint64_t RocksDBBlueFSVolumeSelector::get_effective_extra() const { uint8_t RocksDBBlueFSVolumeSelector::select_prefer_bdev(void* h) { ceph_assert(h != nullptr); uint64_t hint = reinterpret_cast(h); + if (g_ceph_context->_conf->bluefs_debug_force_slow) { + if (hint != LEVEL_LOG) { + return BlueFS::BDEV_SLOW; + } + } uint8_t res; switch (hint) { case LEVEL_SLOW: -- 2.47.3