From 0bbc92e6592b73046c67a9f418841e047e829abf Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 7 Jun 2018 12:12:46 -0500 Subject: [PATCH] os/bluestore: don't store/use path_block.{db,wal} from meta This reverts most of 8d07fa5ad0772b4d979dc10695d230074d1f1e69. ceph-volume goes to great lengths to ensure that the symlinks in the osd dir are accurate. Having these values here is an opportunity to get them out of sync. And that can happen very easily if the initial mkfs was performed using a /dev/sdX device name (which is unstable across reboots). Even after ceph-volume corrects the symlink, bluestore will continue to use the stale device path. Signed-off-by: Sage Weil (cherry picked from commit ef510e43f0ee14b49e99beed9ae8feda6db3429a) --- src/os/bluestore/BlueStore.cc | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 17e485a131932..d2ed285fcea2a 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -4724,9 +4724,7 @@ int BlueStore::_open_db(bool create, bool to_repair_db) string bfn; struct stat st; - if (read_meta("path_block.db", &bfn) < 0) { - bfn = path + "/block.db"; - } + bfn = path + "/block.db"; if (::stat(bfn.c_str(), &st) == 0) { r = bluefs->add_block_device(BlueFS::BDEV_DB, bfn, create && cct->_conf->bdev_enable_discard); @@ -4766,10 +4764,8 @@ int BlueStore::_open_db(bool create, bool to_repair_db) } // shared device - if (read_meta("path_block", &bfn) < 0) { - bfn = path + "/block"; - } - // never trim here + bfn = path + "/block"; + // never trim here r = bluefs->add_block_device(bluefs_shared_bdev, bfn, false); if (r < 0) { derr << __func__ << " add block device(" << bfn << ") returned: " @@ -4798,9 +4794,7 @@ int BlueStore::_open_db(bool create, bool to_repair_db) bluefs_extents.insert(start, initial); } - if (read_meta("path_block.wal", &bfn) < 0) { - bfn = path + "/block.wal"; - } + bfn = path + "/block.wal"; if (::stat(bfn.c_str(), &st) == 0) { r = bluefs->add_block_device(BlueFS::BDEV_WAL, bfn, create && cct->_conf->bdev_enable_discard); @@ -5428,17 +5422,6 @@ int BlueStore::mkfs() if (r < 0) goto out_close_fsid; - { - string wal_path = cct->_conf->get_val("bluestore_block_wal_path"); - if (wal_path.size()) { - write_meta("path_block.wal", wal_path); - } - string db_path = cct->_conf->get_val("bluestore_block_db_path"); - if (db_path.size()) { - write_meta("path_block.db", db_path); - } - } - // choose min_alloc_size if (cct->_conf->bluestore_min_alloc_size) { min_alloc_size = cct->_conf->bluestore_min_alloc_size; -- 2.39.5