mirror of
https://github.com/ceph/ceph
synced 2025-01-20 10:01:45 +00:00
os/bluestore: don't store/use path_block.{db,wal} from meta
This reverts most of 8d07fa5ad0
.
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 <sage@redhat.com>
This commit is contained in:
parent
5b1a58a6f6
commit
ef510e43f0
@ -4725,9 +4725,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);
|
||||
@ -4767,10 +4765,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: "
|
||||
@ -4799,9 +4795,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);
|
||||
@ -5417,17 +5411,6 @@ int BlueStore::mkfs()
|
||||
if (r < 0)
|
||||
goto out_close_fsid;
|
||||
|
||||
{
|
||||
string wal_path = cct->_conf->get_val<string>("bluestore_block_wal_path");
|
||||
if (wal_path.size()) {
|
||||
write_meta("path_block.wal", wal_path);
|
||||
}
|
||||
string db_path = cct->_conf->get_val<string>("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;
|
||||
|
Loading…
Reference in New Issue
Block a user