diff options
author | Igor Fedotov <igor.fedotov@croit.io> | 2023-09-13 15:51:16 +0200 |
---|---|---|
committer | Igor Fedotov <igor.fedotov@croit.io> | 2023-12-04 19:07:10 +0100 |
commit | 334e7fa0879512790e89d1f4d30cd6aaa81f28fa (patch) | |
tree | faab13995a9ad6eda517469f673381e3d1db5e3f /src/os/bluestore/BlueFS.cc | |
parent | Merge pull request #54648 from rhcs-dashboard/fs-rename-fix (diff) | |
download | ceph-334e7fa0879512790e89d1f4d30cd6aaa81f28fa.tar.xz ceph-334e7fa0879512790e89d1f4d30cd6aaa81f28fa.zip |
os/bluestore: adjust and validate bluefs_shared_alloc_size
Make sure it's in-sync (meaning it's higher or equal and properly aligned)
with bluestore_min_alloc_size into account
Fixes: https://tracker.ceph.com/issues/63618
Signed-off-by: Igor Fedotov <igor.fedotov@croit.io>
Diffstat (limited to 'src/os/bluestore/BlueFS.cc')
-rw-r--r-- | src/os/bluestore/BlueFS.cc | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/os/bluestore/BlueFS.cc b/src/os/bluestore/BlueFS.cc index 52857a16081..99851bef94f 100644 --- a/src/os/bluestore/BlueFS.cc +++ b/src/os/bluestore/BlueFS.cc @@ -695,16 +695,24 @@ void BlueFS::_init_alloc() } logger->set(l_bluefs_wal_alloc_unit, wal_alloc_size); + + uint64_t shared_alloc_size = cct->_conf->bluefs_shared_alloc_size; + if (shared_alloc && shared_alloc->a) { + uint64_t unit = shared_alloc->a->get_block_size(); + shared_alloc_size = std::max( + unit, + shared_alloc_size); + ceph_assert(0 == p2phase(shared_alloc_size, unit)); + } if (bdev[BDEV_SLOW]) { alloc_size[BDEV_DB] = cct->_conf->bluefs_alloc_size; - alloc_size[BDEV_SLOW] = cct->_conf->bluefs_shared_alloc_size; - logger->set(l_bluefs_db_alloc_unit, cct->_conf->bluefs_alloc_size); - logger->set(l_bluefs_main_alloc_unit, cct->_conf->bluefs_shared_alloc_size); + alloc_size[BDEV_SLOW] = shared_alloc_size; } else { - alloc_size[BDEV_DB] = cct->_conf->bluefs_shared_alloc_size; - logger->set(l_bluefs_main_alloc_unit, 0); - logger->set(l_bluefs_db_alloc_unit, cct->_conf->bluefs_shared_alloc_size); + alloc_size[BDEV_DB] = shared_alloc_size; + alloc_size[BDEV_SLOW] = 0; } + logger->set(l_bluefs_db_alloc_unit, alloc_size[BDEV_DB]); + logger->set(l_bluefs_main_alloc_unit, alloc_size[BDEV_SLOW]); // new wal and db devices are never shared if (bdev[BDEV_NEWWAL]) { alloc_size[BDEV_NEWWAL] = cct->_conf->bluefs_alloc_size; @@ -718,13 +726,13 @@ void BlueFS::_init_alloc() continue; } ceph_assert(bdev[id]->get_size()); - ceph_assert(alloc_size[id]); if (is_shared_alloc(id)) { dout(1) << __func__ << " shared, id " << id << std::hex << ", capacity 0x" << bdev[id]->get_size() << ", block size 0x" << alloc_size[id] << std::dec << dendl; } else { + ceph_assert(alloc_size[id]); std::string name = "bluefs-"; const char* devnames[] = { "wal","db","slow" }; if (id <= BDEV_SLOW) |