]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
MDSMonitor: fix mds health printed in bad format 21447/head
authorPatrick Donnelly <pdonnell@redhat.com>
Fri, 6 Apr 2018 20:31:27 +0000 (13:31 -0700)
committerPrashant D <pdhange@redhat.com>
Mon, 16 Apr 2018 11:31:30 +0000 (07:31 -0400)
Fixes: http://tracker.ceph.com/issues/23582
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit b551d174e8a847bfa2389c944c6a4befeb679630)

src/mon/MDSMonitor.cc

index 5c51d2f84d554a46d8389ead0a0659e5e96058ef..89764d9121d3c32fd903eb0b78df27b96cdfd71a 100644 (file)
@@ -221,13 +221,15 @@ void MDSMonitor::encode_pending(MonitorDBStore::TransactionRef t)
        mds_metric_summary(metric.type));
       ostringstream ss;
       ss << "mds" << info.name << "(mds." << rank << "): " << metric.message;
-      for (auto p = metric.metadata.begin();
-          p != metric.metadata.end();
-          ++p) {
-       if (p != metric.metadata.begin()) {
+      bool first = true;
+      for (auto &p : metric.metadata) {
+       if (first) {
+         ss << " ";
+       } else {
          ss << ", ";
-       }
-       ss << p->first << ": " << p->second;
+        }
+       ss << p.first << ": " << p.second;
+        first = false;
       }
       check->detail.push_back(ss.str());
     }