From: Sage Weil Date: Mon, 12 Jun 2017 20:15:27 +0000 (-0400) Subject: mon: remove Formatter arg to QuorumService::get_health() X-Git-Tag: v12.1.1~58^2~42 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e170405fd873723bec6ce691afad82641bab2ef1;p=ceph.git mon: remove Formatter arg to QuorumService::get_health() 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 --- diff --git a/PendingReleaseNotes b/PendingReleaseNotes index 03cd6d66dc02..572e45f438b2 100644 --- a/PendingReleaseNotes +++ b/PendingReleaseNotes @@ -199,3 +199,7 @@ 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. diff --git a/src/mon/ConfigKeyService.h b/src/mon/ConfigKeyService.h index 997796873659..7dfb140c7e7c 100644 --- a/src/mon/ConfigKeyService.h +++ b/src/mon/ConfigKeyService.h @@ -57,8 +57,7 @@ public: * @{ */ void init() override { } - void get_health(Formatter *f, - list >& summary, + void get_health(list >& summary, list > *detail) override { } bool service_dispatch(MonOpRequestRef op) override; diff --git a/src/mon/DataHealthService.cc b/src/mon/DataHealthService.cc index 6305263a8092..4a5b42ab3888 100644 --- a/src/mon/DataHealthService.cc +++ b/src/mon/DataHealthService.cc @@ -65,16 +65,10 @@ void DataHealthService::start_epoch() } void DataHealthService::get_health( - Formatter *f, list >& summary, list > *detail) { dout(10) << __func__ << dendl; - if (f) { - f->open_object_section("data_health"); - f->open_array_section("mons"); - } - for (map::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 } } diff --git a/src/mon/DataHealthService.h b/src/mon/DataHealthService.h index 8834b600b8d9..91caf4e32115 100644 --- a/src/mon/DataHealthService.h +++ b/src/mon/DataHealthService.h @@ -65,9 +65,9 @@ public: start_tick(); } - void get_health(Formatter *f, - list >& summary, - list > *detail) override; + void get_health( + list >& summary, + list > *detail) override; int get_type() override { return HealthService::SERVICE_HEALTH_DATA; diff --git a/src/mon/HealthMonitor.cc b/src/mon/HealthMonitor.cc index 0887bdc1b759..2b022b45d8eb 100644 --- a/src/mon/HealthMonitor.cc +++ b/src/mon/HealthMonitor.cc @@ -95,24 +95,14 @@ void HealthMonitor::service_shutdown() services.clear(); } -void HealthMonitor::get_health(Formatter *f, - list >& summary, - list > *detail) +void HealthMonitor::get_health( + list >& summary, + list > *detail) { - if (f) { - f->open_object_section("health"); - f->open_array_section("health_services"); - } - for (map::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); } } diff --git a/src/mon/HealthMonitor.h b/src/mon/HealthMonitor.h index 9d05c64e990a..66e14d687e26 100644 --- a/src/mon/HealthMonitor.h +++ b/src/mon/HealthMonitor.h @@ -39,8 +39,7 @@ public: * @{ */ void init() override; - void get_health(Formatter *f, - list >& summary, + void get_health(list >& summary, list > *detail) override; bool service_dispatch(MonOpRequestRef op) override; diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index ad2ae3eaca5e..cad12467ad4e 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -2462,7 +2462,7 @@ health_status_t Monitor::get_health(list& 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()) { diff --git a/src/mon/QuorumService.h b/src/mon/QuorumService.h index b354c40a77f7..626ce659e573 100644 --- a/src/mon/QuorumService.h +++ b/src/mon/QuorumService.h @@ -117,8 +117,7 @@ public: virtual void init() { } - virtual void get_health(Formatter *f, - list >& summary, + virtual void get_health(list >& summary, list > *detail) = 0; virtual int get_type() = 0; virtual string get_name() const = 0;