]> 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>
Fri, 17 Apr 2020 10:28:56 +0000 (13:28 +0300)
Log it on OSD startup. Previous output lacked bluefs occupation.

Signed-off-by: Igor Fedotov <ifedotov@suse.com>
(cherry picked from commit d2ff682ebcbc9c394df7e17fde854efc52e4351c)

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

index fa0c465d3060e63f8239554cdd53a85e3d93ebd3..e11b773aa6c68b03122ef17d8c9d855dea238942 100644 (file)
@@ -437,11 +437,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 e2c6c70196e0b6cc066e7b405004066c437a662a..6cfee3967ef0b0301e448975e3f457a4d338cb39 100644 (file)
@@ -5093,15 +5093,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;
 }
 
@@ -6879,10 +6881,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;
 }