From: Sage Weil Date: Tue, 26 Jun 2018 11:39:17 +0000 (-0500) Subject: os/bluestore: don't store/use path_block.{db,wal} from meta X-Git-Tag: v12.2.6~7^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1e9fc739cad5faef948361ce7beee2be164cae3a;p=ceph.git 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) # Conflicts: # src/os/bluestore/BlueStore.cc - add_block_device has an extra arg in newer code --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 55a8351e677b..8cf9888f0f79 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -4557,9 +4557,7 @@ int BlueStore::_open_db(bool create) 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); if (r < 0) { @@ -4598,9 +4596,7 @@ int BlueStore::_open_db(bool create) } // shared device - if (read_meta("path_block", &bfn) < 0) { - bfn = path + "/block"; - } + bfn = path + "/block"; r = bluefs->add_block_device(bluefs_shared_bdev, bfn); if (r < 0) { derr << __func__ << " add block device(" << bfn << ") returned: " @@ -4629,9 +4625,7 @@ int BlueStore::_open_db(bool create) 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); if (r < 0) { @@ -5232,17 +5226,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;