]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: Fix default base size for histogram 61679/head
authorAdam Kupczyk <akupczyk@ibm.com>
Thu, 6 Feb 2025 12:37:21 +0000 (12:37 +0000)
committerAdam Kupczyk <akupczyk@ibm.com>
Thu, 6 Feb 2025 18:06:11 +0000 (18:06 +0000)
Use allocator's unit size instead of 4096 as default value.
This makes "bluefs-db" and "bluefs-wal" histograms work on defaults.

+ Fixed error printout

Fixes: https://tracker.ceph.com/issues/69855
Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
src/os/bluestore/Allocator.cc

index f6a3654ab3c0d9b9feb7a3a2318170943a74dee0..603f698e382aac1b32e7a7f144f51e5c19fd8742 100644 (file)
@@ -108,20 +108,20 @@ public:
       f->dump_float("fragmentation_rating", alloc->get_fragmentation());
       f->close_section();
     } else if (command == "bluestore allocator fragmentation histogram " + name) {
-      int64_t alloc_unit = 4096;
+      int64_t alloc_unit = alloc->get_block_size();
       cmd_getval(cmdmap, "alloc_unit", alloc_unit);
       if (alloc_unit <= 0  ||
           p2align(alloc_unit, alloc->get_block_size()) != alloc_unit) {
         ss << "Invalid allocation unit: '" << alloc_unit
-           << ", to be aligned with: '" << alloc->get_block_size()
-           << std::endl;
+           << "', to be aligned with: '" << alloc->get_block_size()
+           << "'" << std::endl;
         return -EINVAL;
       }
       int64_t num_buckets = 8;
       cmd_getval(cmdmap, "num_buckets", num_buckets);
       if (num_buckets < 2) {
         ss << "Invalid amount of buckets (min=2): '" << num_buckets
-           << std::endl;
+           << "'" << std::endl;
         return -EINVAL;
       }