]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: fix weird health-alert daemon key 30617/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Sun, 29 Sep 2019 06:15:07 +0000 (14:15 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Sun, 29 Sep 2019 07:45:55 +0000 (15:45 +0800)
Was:
  19 slow ops, oldest one blocked for 34 sec, daemons [osd,2,osd,4] have slow ops.

Now:
  153 slow ops, oldest one blocked for 38 sec, daemons [osd.3,osd.4,osd.5] have slow ops.

Fixes: https://tracker.ceph.com/issues/42079
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/mgr/DaemonHealthMetricCollector.cc

index 0f4d5bd643e2f30c64b72eae50f907ac1c9033f9..711ebe60da8d9ebb7f783ab5a7ca1e4a40ef3fb2 100644 (file)
@@ -11,6 +11,23 @@ ostream& operator<<(ostream& os,
   return os << daemon.first << "." << daemon.second;
 }
 
+// define operator<<(ostream&, const vector<DaemonKey>&) after
+// ostream& operator<<(ostream&, const DaemonKey&), so that C++'s
+// ADL can use the former instead of using the generic one:
+// operator<<(ostream&, const std::pair<A,B>&)
+ostream& operator<<(
+   ostream& os,
+   const vector<DaemonHealthMetricCollector::DaemonKey>& daemons)
+{
+  os << "[";
+  for (auto d = daemons.begin(); d != daemons.end(); ++d) {
+    if (d != daemons.begin()) os << ",";
+    os << *d;
+  }
+  os << "]";
+  return os;
+}
+
 namespace {
 
 class SlowOps final : public DaemonHealthMetricCollector {