]> git-server-git.apps.pok.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>
Fri, 21 Mar 2025 17:25:18 +0000 (20:25 +0300)
Signed-off-by: Igor Fedotov <igor.fedotov@croit.io>
src/os/bluestore/BlueFS.cc
src/os/bluestore/BlueStore.cc
src/os/bluestore/bluefs_types.h

index 8c7c85a8ea3f72ab4cd0427efecc73c3fd0759a1..ad1327ebb8d850fafee38fab216da97456997e20 100644 (file)
@@ -827,15 +827,17 @@ 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]
               << ", max alloc size 0x" << super.bluefs_max_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(),
                                    super.bluefs_max_alloc_size[id],
                                    name);
@@ -1174,10 +1176,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 7dca7f49f1e51817c81dd02a9947ca2668bbf210..c54bc3bb28a97281b83eb68114d8fe41f771e108 100644 (file)
@@ -12009,6 +12009,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 08b3ca0cf41adeee97339affac3beebbc37ad508..d4ba5f8aa5cb1ea0c8db78540db78a101b3bbeed 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;