The PR didn't have an issue attached to it.
(merged) Master PR https://github.com/ceph/ceph/pull/22462
(merged) Backport to Mimic https://github.com/ceph/ceph/pull/22477
I was unable to backport to Luminous as it has conflicts I couldn't resolve on the C++ side.
diff --cc src/os/bluestore/BlueStore.cc
index 55a8351e67,9228a9da52..0000000000
--- a/src/os/bluestore/BlueStore.cc
+++ b/src/os/bluestore/BlueStore.cc
@@@ -4557,11 -4725,10 +4557,9 @@@ 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,
- create && cct->_conf->bdev_enable_discard);
+ r = bluefs->add_block_device(BlueFS::BDEV_DB, bfn);
if (r < 0) {
derr << __func__ << " add block device(" << bfn << ") returned: "
<< cpp_strerror(r) << dendl;
@@@ -4598,10 -4765,9 +4596,22 @@@
}
// shared device
++<<<<<<< HEAD
+ if (read_meta("path_block", &bfn) < 0) {
+ bfn = path + "/block";
+ }
+ r = bluefs->add_block_device(bluefs_shared_bdev, bfn);
++||||||| parent of ef510e43f0... os/bluestore: don't store/use path_block.{db,wal} from meta
++ if (read_meta("path_block", &bfn) < 0) {
++ bfn = path + "/block";
++ }
++ // never trim here
++ r = bluefs->add_block_device(bluefs_shared_bdev, bfn, false);
++=======
+ bfn = path + "/block";
+ // never trim here
+ r = bluefs->add_block_device(bluefs_shared_bdev, bfn, false);
++>>>>>>> ef510e43f0... os/bluestore: don't store/use path_block.{db,wal} from meta
if (r < 0) {
derr << __func__ << " add block device(" << bfn << ") returned: "
<< cpp_strerror(r) << dendl;
@@@ -4629,11 -4795,10 +4639,9 @@@
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);
+ r = bluefs->add_block_device(BlueFS::BDEV_WAL, bfn);
if (r < 0) {
derr << __func__ << " add block device(" << bfn << ") returned: "
<< cpp_strerror(r) << dendl;