]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: fix bluefs migrate command 43140/head
authorIgor Fedotov <ifedotov@suse.com>
Tue, 31 Aug 2021 12:54:23 +0000 (15:54 +0300)
committerIgor Fedotov <ifedotov@suse.com>
Fri, 10 Sep 2021 21:31:16 +0000 (00:31 +0300)
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 <ifedotov@suse.com>
(cherry picked from commit 90852d9b6f0da7967121200c9a1c56bed1929d2d)

src/os/bluestore/BlueFS.cc
src/os/bluestore/BlueStore.cc

index bc6d34012bcbf4aa71791824925df19fb0ffdf1e..8e835eba2fee11f3fde1af694742dce0f51ea0b1 100644 (file)
@@ -4032,7 +4032,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
index 2bd5ac8648ad40476562a52a068553e83e99bf12..1da41d99a08a04191b36b284e4b32b3d1883d3c9 100644 (file)
@@ -6062,9 +6062,7 @@ int BlueStore::_open_db(bool create, bool to_repair_db, 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) {