]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: make bluefs spillover messages nicer
authorSage Weil <sage@redhat.com>
Sun, 10 Mar 2019 21:39:51 +0000 (16:39 -0500)
committerSage Weil <sage@redhat.com>
Sun, 10 Mar 2019 21:46:49 +0000 (16:46 -0500)
Was

 osd:50 spilled over to slow device: 1.3 GiB

Now

 osd.0 spilled over 1.7 GiB metadata from 'db' device (1000 MiB used of 1024 MiB) to slow device

Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/PGMap.cc
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h

index c40a6b32a8d29c81d9fa11b12dcac9b24ec1c971..9967cad86234a364283e1c8c42b70b9421cc81d7 100644 (file)
@@ -2966,7 +2966,7 @@ void PGMap::get_health_checks(
 
     for (auto& a : osd_sum.os_alerts) {
       int left = max;
-      string s0 = " osd:";
+      string s0 = " osd.";
       s0 += stringify(a.first);
       for (auto& aa : a.second) {
         string s(s0);
index a01e41fc202c256973997aaa632bb59cc64a8977..114927a951a3412f29fd57fb3c3fb4899ca5500d 100644 (file)
@@ -5655,9 +5655,12 @@ int BlueStore::_balance_bluefs_freespace()
   if (bluefs_shared_bdev == BlueFS::BDEV_SLOW) {
     auto& p = bluefs_usage[bluefs_shared_bdev];
     if (p.first != p.second) {
-      string s("spilled over to slow device: ");
-      s += stringify(byte_u_t(p.second - p.first));
-      _set_spillover_alert(s.c_str());
+      auto& db = bluefs_usage[BlueFS::BDEV_DB];
+      ostringstream ss;
+      ss << "spilled over " << byte_u_t(p.second - p.first)
+        << " metadata from 'db' device (" << byte_u_t(db.second - db.first)
+        << " used of " << byte_u_t(db.second) << ") to slow device";
+      _set_spillover_alert(ss.str());
       clear_alert = false;
     }
   }
index 7dbe29706b27cc2ba5c77e97201ddc0fbb16cf60..f734a4550fd86ebcc1986f0f182af76512d5e57e 100644 (file)
@@ -2711,7 +2711,7 @@ private:
     failed_cmode.clear();
   }
 
-  void _set_spillover_alert(const char* s) {
+  void _set_spillover_alert(const string& s) {
     std::lock_guard l(qlock);
     spillover_alert = s;
   }