]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/PGMap: Summarise OSDs in blocked/stuck requests 21760/head
authorBrad Hubbard <bhubbard@redhat.com>
Tue, 3 Apr 2018 07:49:08 +0000 (17:49 +1000)
committerBrad Hubbard <bhubbard@redhat.com>
Fri, 4 May 2018 05:21:27 +0000 (15:21 +1000)
This fix is luminous specific since this code was changed in Mimic to
use the new SLOW_OPS errors.

Fixes: https://tracker.ceph.com/issues/23205
Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
src/mon/PGMap.cc

index 504adb53cd9420c09b98355b2a6c96cd4f882fb2..db19af04235944bdcde2f23ba39465d2e8b1086f 100644 (file)
@@ -3185,14 +3185,11 @@ void PGMap::get_health_checks(
     }
 
     if (!warn_detail.empty()) {
-      ostringstream ss;
-      ss << warn << " slow requests are blocked > "
-        << cct->_conf->mon_osd_warn_op_age << " sec";
-      auto& d = checks->add("REQUEST_SLOW", HEALTH_WARN, ss.str());
-      d.detail.swap(warn_detail);
       int left = max;
+      set<int> implicated_osds;
       for (auto& p : warn_osd_by_max) {
        ostringstream ss;
+        implicated_osds.insert(p.second.begin(), p.second.end());
        if (p.second.size() > 1) {
          ss << "osds " << p.second
              << " have blocked requests > " << p.first << " sec";
@@ -3200,21 +3197,24 @@ void PGMap::get_health_checks(
          ss << "osd." << *p.second.begin()
              << " has blocked requests > " << p.first << " sec";
        }
-       d.detail.push_back(ss.str());
+       warn_detail.push_back(ss.str());
        if (--left == 0) {
          break;
        }
       }
+      ostringstream ss;
+      ss << warn << " slow requests are blocked > "
+        << cct->_conf->mon_osd_warn_op_age << " sec. Implicated osds "
+         << implicated_osds;
+      auto& d = checks->add("REQUEST_SLOW", HEALTH_WARN, ss.str());
+      d.detail.swap(warn_detail);
     }
     if (!error_detail.empty()) {
-      ostringstream ss;
-      ss << error << " stuck requests are blocked > "
-        << err_age << " sec";
-      auto& d = checks->add("REQUEST_STUCK", HEALTH_ERR, ss.str());
-      d.detail.swap(error_detail);
       int left = max;
+      set<int> implicated_osds;
       for (auto& p : error_osd_by_max) {
        ostringstream ss;
+        implicated_osds.insert(p.second.begin(), p.second.end());
        if (p.second.size() > 1) {
          ss << "osds " << p.second
              << " have stuck requests > " << p.first << " sec";
@@ -3222,11 +3222,16 @@ void PGMap::get_health_checks(
          ss << "osd." << *p.second.begin()
              << " has stuck requests > " << p.first << " sec";
        }
-       d.detail.push_back(ss.str());
+       error_detail.push_back(ss.str());
        if (--left == 0) {
          break;
        }
       }
+      ostringstream ss;
+      ss << error << " stuck requests are blocked > "
+        << err_age << " sec. Implicated osds " << implicated_osds;
+      auto& d = checks->add("REQUEST_STUCK", HEALTH_ERR, ss.str());
+      d.detail.swap(error_detail);
     }
   }