From 1f7435094b1a4055def9361e57db1d04d7db6e82 Mon Sep 17 00:00:00 2001 From: Igor Fedotov Date: Tue, 31 Aug 2021 15:54:23 +0300 Subject: [PATCH] os/bluestore: fix bluefs migrate command After migrating DB volume to a slow one RocksDB still needs to be provided with slow.db path to properly access relevant files under db.slow subfolder. Without that specification it tries to access them under 'db' one which results in "not-found" error. Fixes: https://tracker.ceph.com/issues/40434 Signed-off-by: Igor Fedotov (cherry picked from commit 90852d9b6f0da7967121200c9a1c56bed1929d2d) --- src/os/bluestore/BlueFS.cc | 4 +++- src/os/bluestore/BlueStore.cc | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/os/bluestore/BlueFS.cc b/src/os/bluestore/BlueFS.cc index 2ddfbbed0f2..16b64636b89 100644 --- a/src/os/bluestore/BlueFS.cc +++ b/src/os/bluestore/BlueFS.cc @@ -3837,7 +3837,9 @@ uint8_t OriginalVolumeSelector::select_prefer_bdev(void* hint) void OriginalVolumeSelector::get_paths(const std::string& base, paths& res) const { res.emplace_back(base, db_total); - res.emplace_back(base + ".slow", slow_total); + res.emplace_back(base + ".slow", + slow_total ? slow_total : db_total); // use fake non-zero value if needed to + // avoid RocksDB complains } #undef dout_prefix diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index e74343cdfd0..ba52666a011 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -6021,9 +6021,7 @@ int BlueStore::_prepare_db_environment(bool create, bool read_only, BlueFSVolumeSelector::paths paths; bluefs->get_vselector_paths(fn, paths); - if (bluefs_layout.shared_bdev == BlueFS::BDEV_SLOW) { - // we have both block.db and block; tell rocksdb! - // note: the second (last) size value doesn't really matter + { ostringstream db_paths; bool first = true; for (auto& p : paths) { -- 2.47.3