void BlueStore::_close_db_and_around(bool read_only)
{
- _close_db(read_only);
+ if (db) {
+ _close_db_leave_bluefs();
+ }
+ if (bluefs) {
+ _close_bluefs(read_only);
+ }
_close_fm();
_close_alloc();
_close_bdev();
}
}
+void BlueStore::_close_db_leave_bluefs()
+{
+ ceph_assert(db);
+ delete db;
+ db = nullptr;
+}
+
void BlueStore::_dump_alloc_on_failure()
{
auto dump_interval =
dout(20) << __func__ << " closing" << dendl;
}
+ _close_db_leave_bluefs();
// GBH - Vault the allocation state
dout(5) << "NCB::BlueStore::umount->store_allocation_state_on_bluestore() " << dendl;
if (was_mounted && fm->is_null_manager()) {
//-----------------------------------------------------------------------------------
int BlueStore::store_allocator(Allocator* src_allocator)
{
+ // when storing allocations to file we must be sure there is no background compactions
+ // the easiest way to achieve it is to make sure db is closed
+ ceph_assert(db == nullptr);
utime_t start_time = ceph_clock_now();
int ret = 0;
}
if (test_store_and_restore) {
+ _close_db_leave_bluefs();
dout(5) << "calling store_allocator(shared_alloc.a)" << dendl;
store_allocator(shared_alloc.a);
Allocator* alloc2 = create_bitmap_allocator(bdev_size);
bool to_repair_db=false,
bool read_only = false);
void _close_db(bool read_only);
+ void _close_db_leave_bluefs();
int _open_fm(KeyValueDB::Transaction t, bool read_only, bool fm_restore = false);
void _close_fm();
int _write_out_fm_meta(uint64_t target_size);