Skip to content

Commit

Permalink
Merge PR ceph#43645 into master
Browse files Browse the repository at this point in the history
* refs/pull/43645/head:
	os/bluestore: Disable compaction then no-column-b is storing allocations to bluefs file

Reviewed-by: Igor Fedotov <[email protected]>
Reviewed-by: Gabriel Benhanokh <[email protected]>
  • Loading branch information
liewegas committed Oct 28, 2021
2 parents 78d6ac0 + 867f0a2 commit c9e647a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions .githubmap
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,4 @@ yuyuyu101 Haomai Wang <[email protected]>
zdover23 Zac Dover <[email protected]>
Thingee Mike Perez <[email protected]>
cfsnyder Cory Snyder <[email protected]>
benhanokh Gabriel Benhanokh <[email protected]>
19 changes: 18 additions & 1 deletion src/os/bluestore/BlueStore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6089,7 +6089,12 @@ int BlueStore::_open_db_and_around(bool read_only, bool to_repair)

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();
Expand Down Expand Up @@ -6327,6 +6332,13 @@ void BlueStore::_close_db(bool cold_close)
}
}

void BlueStore::_close_db_leave_bluefs()
{
ceph_assert(db);
delete db;
db = nullptr;
}

void BlueStore::_dump_alloc_on_failure()
{
auto dump_interval =
Expand Down Expand Up @@ -7274,6 +7286,7 @@ int BlueStore::umount()
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()) {
Expand Down Expand Up @@ -17210,6 +17223,9 @@ const unsigned MAX_EXTENTS_IN_BUFFER = 4 * 1024; // 4K extents = 64KB of data
//-----------------------------------------------------------------------------------
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;

Expand Down Expand Up @@ -17989,6 +18005,7 @@ int BlueStore::read_allocation_from_drive_for_bluestore_tool(bool test_store_and
}

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);
Expand Down
1 change: 1 addition & 0 deletions src/os/bluestore/BlueStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -2403,6 +2403,7 @@ class BlueStore : public ObjectStore,
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);
Expand Down

0 comments on commit c9e647a

Please sign in to comment.