Skip to content

Commit 1aae3b6

Browse files
committed
os/bluestore: show allocator types in metadata dump
Signed-off-by: Igor Fedotov <[email protected]>
1 parent 2bb6ae3 commit 1aae3b6

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

src/os/bluestore/BlueFS.cc

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -827,15 +827,17 @@ void BlueFS::_init_alloc()
827827
name += devnames[id];
828828
else
829829
name += to_string(uintptr_t(this));
830+
string alloc_type = cct->_conf->bluefs_allocator;
831+
830832
dout(1) << __func__ << " new, id " << id << std::hex
831833
<< ", allocator name " << name
832-
<< ", allocator type " << cct->_conf->bluefs_allocator
834+
<< ", allocator type " << alloc_type
833835
<< ", capacity 0x" << bdev[id]->get_size()
834836
<< ", reserved 0x" << block_reserved[id]
835837
<< ", block size 0x" << alloc_size[id]
836838
<< ", max alloc size 0x" << super.bluefs_max_alloc_size[id]
837839
<< std::dec << dendl;
838-
alloc[id] = Allocator::create(cct, cct->_conf->bluefs_allocator,
840+
alloc[id] = Allocator::create(cct, alloc_type,
839841
bdev[id]->get_size(),
840842
super.bluefs_max_alloc_size[id],
841843
name);
@@ -1174,10 +1176,14 @@ int BlueFS::prepare_new_device(int id, const bluefs_layout_t& layout)
11741176

11751177
void BlueFS::collect_metadata(map<string,string> *pm, unsigned skip_bdev_id)
11761178
{
1177-
if (skip_bdev_id != BDEV_DB && bdev[BDEV_DB])
1179+
if (skip_bdev_id != BDEV_DB && bdev[BDEV_DB]) {
11781180
bdev[BDEV_DB]->collect_metadata("bluefs_db_", pm);
1179-
if (bdev[BDEV_WAL])
1181+
(*pm)["bluefs_db_allocator"]= alloc[BDEV_DB] ? alloc[BDEV_DB]->get_type(): "null";
1182+
}
1183+
if (bdev[BDEV_WAL]) {
11801184
bdev[BDEV_WAL]->collect_metadata("bluefs_wal_", pm);
1185+
(*pm)["bluefs_wal_allocator"]= alloc[BDEV_WAL] ? alloc[BDEV_WAL]->get_type(): "null";
1186+
}
11811187
}
11821188

11831189
void BlueFS::get_devices(set<string> *ls)

src/os/bluestore/BlueStore.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12009,6 +12009,7 @@ void BlueStore::collect_metadata(map<string,string> *pm)
1200912009
}
1201012010
(*pm)["bluestore_min_alloc_size"] = stringify(min_alloc_size);
1201112011
(*pm)["bluestore_allocation_from_file"] = stringify(fm && fm->is_null_manager());
12012+
(*pm)["bluestore_allocator"] = alloc ? alloc->get_type() : "null";
1201212013
}
1201312014

1201412015
int BlueStore::get_numa_node(

src/os/bluestore/bluefs_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ WRITE_CLASS_ENCODER(bluefs_layout_t)
213213
struct bluefs_super_t {
214214
uuid_d uuid; ///< unique to this bluefs instance
215215
uuid_d osd_uuid; ///< matches the osd that owns us
216-
uint64_t version;
216+
uint64_t version; ///< In fact that's update counter
217217
uint32_t block_size;
218218

219219
bluefs_fnode_t log_fnode;

0 commit comments

Comments
 (0)