]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: remove Formatter arg to QuorumService::get_health()
authorSage Weil <sage@redhat.com>
Mon, 12 Jun 2017 20:15:27 +0000 (16:15 -0400)
committerSage Weil <sage@redhat.com>
Wed, 12 Jul 2017 16:51:30 +0000 (12:51 -0400)
This is used to dump extra weirdness to the health detail structured
output, but we are about to remove all of that in luminous.

Signed-off-by: Sage Weil <sage@redhat.com>
PendingReleaseNotes
src/mon/ConfigKeyService.h
src/mon/DataHealthService.cc
src/mon/DataHealthService.h
src/mon/HealthMonitor.cc
src/mon/HealthMonitor.h
src/mon/Monitor.cc
src/mon/QuorumService.h

index 03cd6d66dc0251c2ee628fd86c123f694989e147..572e45f438b2a4ca89425e083783f71b1dab4976 100644 (file)
   a 'timechecks' section describing the time sync status.  This
   information is now available via the 'ceph time-sync-status'
   command.
+
+* Certain extra fields in the 'ceph health' structured output that
+  used to appear if the mons were low on disk space (which duplicated
+  the information in the normal health warning messages) are now gone.
index 9977968736593e8c57760b0cd336e44edba64a7e..7dfb140c7e7c3a34f38e8a804ee21bb1718292c1 100644 (file)
@@ -57,8 +57,7 @@ public:
    * @{
    */
   void init() override { }
-  void get_health(Formatter *f,
-                  list<pair<health_status_t,string> >& summary,
+  void get_health(list<pair<health_status_t,string> >& summary,
                   list<pair<health_status_t,string> > *detail) override { }
   bool service_dispatch(MonOpRequestRef op) override;
 
index 6305263a809206136a4f1d38193bc225a1e376ac..4a5b42ab388897075a0499762cc64e6aa606c8d1 100644 (file)
@@ -65,16 +65,10 @@ void DataHealthService::start_epoch()
 }
 
 void DataHealthService::get_health(
-    Formatter *f,
     list<pair<health_status_t,string> >& summary,
     list<pair<health_status_t,string> > *detail)
 {
   dout(10) << __func__ << dendl;
-  if (f) {
-    f->open_object_section("data_health");
-    f->open_array_section("mons");
-  }
-
   for (map<entity_inst_t,DataStats>::iterator it = stats.begin();
        it != stats.end(); ++it) {
     string mon_name = mon->monmap->get_name(it->first.addr);
@@ -110,22 +104,6 @@ void DataHealthService::get_health(
       if (detail)
        detail->push_back(make_pair(health_status, ss.str()));
     }
-
-    if (f) {
-      f->open_object_section("mon");
-      f->dump_string("name", mon_name.c_str());
-      // leave this unenclosed by an object section to avoid breaking backward-compatibility
-      stats.dump(f);
-      f->dump_stream("health") << health_status;
-      if (health_status != HEALTH_OK)
-        f->dump_string("health_detail", health_detail);
-      f->close_section();
-    }
-  }
-
-  if (f) {
-    f->close_section(); // mons
-    f->close_section(); // data_health
   }
 }
 
index 8834b600b8d9c83bc8cbb9bbadc07ebca8699506..91caf4e32115c394cb96aff9b476a6767aad05e7 100644 (file)
@@ -65,9 +65,9 @@ public:
     start_tick();
   }
 
-  void get_health(Formatter *f,
-                          list<pair<health_status_t,string> >& summary,
-                          list<pair<health_status_t,string> > *detail) override;
+  void get_health(
+    list<pair<health_status_t,string> >& summary,
+    list<pair<health_status_t,string> > *detail) override;
 
   int get_type() override {
     return HealthService::SERVICE_HEALTH_DATA;
index 0887bdc1b759f81d57b90fd66672ca713f8b8303..2b022b45d8eb144529c9cd7da6e0db1998cc6cd6 100644 (file)
@@ -95,24 +95,14 @@ void HealthMonitor::service_shutdown()
   services.clear();
 }
 
-void HealthMonitor::get_health(Formatter *f,
-                              list<pair<health_status_t,string> >& summary,
-                              list<pair<health_status_t,string> > *detail)
+void HealthMonitor::get_health(
+  list<pair<health_status_t,string> >& summary,
+  list<pair<health_status_t,string> > *detail)
 {
-  if (f) {
-    f->open_object_section("health");
-    f->open_array_section("health_services");
-  }
-
   for (map<int,HealthService*>::iterator it = services.begin();
        it != services.end();
        ++it) {
-    it->second->get_health(f, summary, detail);
-  }
-
-  if (f) {
-    f->close_section(); // health_services
-    f->close_section(); // health
+    it->second->get_health(summary, detail);
   }
 }
 
index 9d05c64e990a553957e73b65c2c76c28c3260f56..66e14d687e265b586957da7a250b91e1b4d9be98 100644 (file)
@@ -39,8 +39,7 @@ public:
    * @{
    */
   void init() override;
-  void get_health(Formatter *f,
-                 list<pair<health_status_t,string> >& summary,
+  void get_health(list<pair<health_status_t,string> >& summary,
                  list<pair<health_status_t,string> > *detail) override;
   bool service_dispatch(MonOpRequestRef op) override;
 
index ad2ae3eaca5e943226abf5df0d0d51f0f481e428..cad12467ad4eb780c8a1cd9721cc58177fa75fa2 100644 (file)
@@ -2462,7 +2462,7 @@ health_status_t Monitor::get_health(list<string>& status,
     s->get_health(summary, detailbl ? &detail : NULL, cct);
   }
 
-  health_monitor->get_health(f, summary, (detailbl ? &detail : NULL));
+  health_monitor->get_health(summary, (detailbl ? &detail : NULL));
 
   health_status_t overall = HEALTH_OK;
   if (!timecheck_skews.empty()) {
index b354c40a77f77d459a9640901c68264879e58a0e..626ce659e573c238e891611adf6f09f96c1b2aae 100644 (file)
@@ -117,8 +117,7 @@ public:
 
   virtual void init() { }
 
-  virtual void get_health(Formatter *f,
-                         list<pair<health_status_t,string> >& summary,
+  virtual void get_health(list<pair<health_status_t,string> >& summary,
                           list<pair<health_status_t,string> > *detail) = 0;
   virtual int get_type() = 0;
   virtual string get_name() const = 0;