#include "messages/PaxosServiceMessage.h"
#include "include/types.h"
#include "include/health.h"
+#include "mon/health_check.h"
class MMonMgrReport : public PaxosServiceMessage {
public:
// PGMapDigest is in data payload
- list<pair<health_status_t,std::string>> health_summary, health_detail;
+ health_check_map_t health_checks;
bufferlist service_map_bl; // encoded ServiceMap
MMonMgrReport()
void encode_payload(uint64_t features) override {
paxos_encode();
- ::encode(health_summary, payload);
- ::encode(health_detail, payload);
+ ::encode(health_checks, payload);
::encode(service_map_bl, payload);
}
void decode_payload() override {
bufferlist::iterator p = payload.begin();
paxos_decode(p);
- ::decode(health_summary, p);
- ::decode(health_detail, p);
+ ::decode(health_checks, p);
::decode(service_map_bl, p);
}
};
}
}
- // FIXME: reporting health detail here might be a bad idea?
cluster_state.with_osdmap([&](const OSDMap& osdmap) {
// FIXME: no easy way to get mon features here. this will do for
// now, though, as long as we don't make a backward-incompat change.
pg_map.encode_digest(osdmap, m->get_data(), CEPH_FEATURES_ALL);
dout(10) << pg_map << dendl;
- pg_map.get_health(g_ceph_context, osdmap,
- m->health_summary,
- &m->health_detail);
+
+ pg_map.get_health_checks(g_ceph_context, osdmap,
+ &m->health_checks);
});
});
// TODO? We currently do not notify the PyModules
{
version = get_last_committed();
dout(10) << " " << version << dendl;
+ load_health();
bufferlist bl;
get_version(version, bl);
if (version) {
try {
auto p = bl.begin();
::decode(digest, p);
- ::decode(health_summary, p);
- ::decode(health_detail, p);
::decode(service_map, p);
dout(10) << __func__ << " v" << version
<< " service_map e" << service_map.epoch << dendl;
{
dout(10) << " " << version << dendl;
pending_digest = digest;
- pending_health_summary = health_summary;
- pending_health_detail = health_detail;
+ pending_health_checks = get_health_checks();
pending_service_map_bl.clear();
::encode(service_map, pending_service_map_bl, mon->get_quorum_con_features());
}
dout(10) << " " << version << dendl;
bufferlist bl;
::encode(pending_digest, bl, mon->get_quorum_con_features());
- ::encode(pending_health_summary, bl);
- ::encode(pending_health_detail, bl);
assert(pending_service_map_bl.length());
bl.append(pending_service_map_bl);
put_version(t, version, bl);
put_last_committed(t, version);
+
+ encode_health(pending_health_checks, t);
}
version_t MgrStatMonitor::get_trim_to()
list<pair<health_status_t,string> > *detail,
CephContext *cct) const
{
- if (mon->osdmon()->osdmap.require_osd_release < CEPH_RELEASE_LUMINOUS) {
- return;
- }
-
- summary.insert(summary.end(), health_summary.begin(), health_summary.end());
- if (detail) {
- detail->insert(detail->end(), health_detail.begin(), health_detail.end());
- }
}
void MgrStatMonitor::tick()
auto p = bl.begin();
::decode(pending_digest, p);
dout(10) << __func__ << " " << pending_digest << dendl;
- pending_health_summary.swap(m->health_summary);
- pending_health_detail.swap(m->health_detail);
+ pending_health_checks.swap(m->health_checks);
if (m->service_map_bl.length()) {
pending_service_map_bl.swap(m->service_map_bl);
}
// live version
version_t version = 0;
PGMapDigest digest;
- list<pair<health_status_t,string>> health_summary;
- list<pair<health_status_t,string>> health_detail;
ServiceMap service_map;
// pending commit
PGMapDigest pending_digest;
- list<pair<health_status_t,string>> pending_health_summary;
- list<pair<health_status_t,string>> pending_health_detail;
+ health_check_map_t pending_health_checks;
bufferlist pending_service_map_bl;
std::unique_ptr<MgrPGStatService> pgservice;