]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: be more informative about main device's avail space.
authorIgor Fedotov <ifedotov@suse.com>
Mon, 16 Mar 2020 14:02:51 +0000 (17:02 +0300)
committerIgor Fedotov <ifedotov@suse.com>
Wed, 25 Mar 2020 20:54:28 +0000 (23:54 +0300)
Log it on OSD startup. Previous output lacked bluefs occupation.

Signed-off-by: Igor Fedotov <ifedotov@suse.com>
src/os/bluestore/BlueFS.cc
src/os/bluestore/BlueStore.cc

index cf65bf754add812727be5a353b92b3ea43d4a33d..7e9e967385742b1d1e2c0a5383a37ff673095292 100644 (file)
@@ -455,11 +455,10 @@ void BlueFS::dump_block_extents(ostream& out)
         << " = 0x" << owned
         << " : using 0x" << owned - free
        << std::dec << "(" << byte_u_t(owned - free) << ")";
-    if (i == BDEV_SLOW) {
+    if (i == _get_slow_device_id()) {
       ceph_assert(slow_dev_expander);
-      int id = _get_slow_device_id();
-      ceph_assert(alloc[id]);
-      free = slow_dev_expander->available_freespace(alloc_size[id]);
+      ceph_assert(alloc[i]);
+      free = slow_dev_expander->available_freespace(alloc_size[i]);
       out << std::hex
           << " : bluestore has 0x" << free
           << std::dec << "(" << byte_u_t(free) << ") available";
index c96fe26e90a5f8da3e4c36f7b7ffd4e30509212e..bacbf3980b78d36bfe17455e2b0bd486f6714e46 100644 (file)
@@ -5118,15 +5118,17 @@ int BlueStore::_open_alloc()
     bytes += length;
   }
   fm->enumerate_reset();
-  dout(1) << __func__ << " loaded " << byte_u_t(bytes)
-         << " in " << num << " extents"
-         << dendl;
 
   // also mark bluefs space as allocated
   for (auto e = bluefs_extents.begin(); e != bluefs_extents.end(); ++e) {
     alloc->init_rm_free(e.get_start(), e.get_len());
   }
 
+  dout(1) << __func__ << " loaded " << byte_u_t(bytes)
+    << " in " << num << " extents"
+    << " available " << byte_u_t(alloc->get_free())
+    << dendl;
+
   return 0;
 }
 
@@ -6904,10 +6906,10 @@ int BlueStore::expand_devices(ostream& out)
 
 int BlueStore::dump_bluefs_sizes(ostream& out)
 {
-  int r = _mount(true);
+  int r = cold_open();
   ceph_assert(r == 0);
   bluefs->dump_block_extents(out);
-  umount();
+  cold_close();
   return r;
 }