]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: show allocator types in metadata dump
authorIgor Fedotov <igor.fedotov@croit.io>
Fri, 28 Feb 2025 07:54:57 +0000 (10:54 +0300)
committerIgor Fedotov <igor.fedotov@croit.io>
Tue, 29 Apr 2025 09:01:50 +0000 (12:01 +0300)
Signed-off-by: Igor Fedotov <igor.fedotov@croit.io>
(cherry picked from commit 1aae3b66fa55f893f7ec002854bb699541635d53)

src/os/bluestore/BlueFS.cc
src/os/bluestore/BlueStore.cc
src/os/bluestore/bluefs_types.h

index 16f62c663b9436c33f5a067f01429ec029d516b4..e22f5df40cc4ab0c60e730d5184c5f928614e194 100644 (file)
@@ -775,14 +775,16 @@ void BlueFS::_init_alloc()
         name += devnames[id];
       else
         name += to_string(uintptr_t(this));
+      string alloc_type = cct->_conf->bluefs_allocator;
+
       dout(1) << __func__ << " new, id " << id << std::hex
               << ", allocator name " << name
-              << ", allocator type " << cct->_conf->bluefs_allocator
+              << ", allocator type " << alloc_type
               << ", capacity 0x" << bdev[id]->get_size()
               << ", reserved 0x" << block_reserved[id]
               << ", block size 0x" << alloc_size[id]
               << std::dec << dendl;
-      alloc[id] = Allocator::create(cct, cct->_conf->bluefs_allocator,
+      alloc[id] = Allocator::create(cct, alloc_type,
                                    bdev[id]->get_size(),
                                    alloc_size[id],
                                    name);
@@ -1120,10 +1122,14 @@ int BlueFS::prepare_new_device(int id, const bluefs_layout_t& layout)
 
 void BlueFS::collect_metadata(map<string,string> *pm, unsigned skip_bdev_id)
 {
-  if (skip_bdev_id != BDEV_DB && bdev[BDEV_DB])
+  if (skip_bdev_id != BDEV_DB && bdev[BDEV_DB]) {
     bdev[BDEV_DB]->collect_metadata("bluefs_db_", pm);
-  if (bdev[BDEV_WAL])
+    (*pm)["bluefs_db_allocator"]= alloc[BDEV_DB] ? alloc[BDEV_DB]->get_type(): "null";
+  }
+  if (bdev[BDEV_WAL]) {
     bdev[BDEV_WAL]->collect_metadata("bluefs_wal_", pm);
+    (*pm)["bluefs_wal_allocator"]= alloc[BDEV_WAL] ? alloc[BDEV_WAL]->get_type(): "null";
+  }
 }
 
 void BlueFS::get_devices(set<string> *ls)
index a4912332979dbc274518523fe94ce7968aee9290..7601966c3ff5c62f9569df86d4bcbf9e44e5568c 100644 (file)
@@ -11865,6 +11865,7 @@ void BlueStore::collect_metadata(map<string,string> *pm)
   }
   (*pm)["bluestore_min_alloc_size"] = stringify(min_alloc_size);
   (*pm)["bluestore_allocation_from_file"] = stringify(fm && fm->is_null_manager());
+  (*pm)["bluestore_allocator"] = alloc ? alloc->get_type() : "null";
 }
 
 int BlueStore::get_numa_node(
index 2323e5ed6a35867ec674cc98e3b924a6a5733e4c..99ce1c3c1461eeadec635a62a37eed9118708285 100644 (file)
@@ -213,7 +213,7 @@ WRITE_CLASS_ENCODER(bluefs_layout_t)
 struct bluefs_super_t {
   uuid_d uuid;      ///< unique to this bluefs instance
   uuid_d osd_uuid;  ///< matches the osd that owns us
-  uint64_t version;
+  uint64_t version; ///< In fact that's update counter
   uint32_t block_size;
 
   bluefs_fnode_t log_fnode;