mirror of
https://github.com/ceph/ceph
synced 2025-02-24 03:27:10 +00:00
mon: health WARN if monitor quorum is incomplete
Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
parent
e93c0fc08b
commit
3865ca5688
@ -253,3 +253,16 @@ void MonmapMonitor::tick()
|
||||
update_from_paxos();
|
||||
}
|
||||
|
||||
enum health_status_t MonmapMonitor::get_health(std::ostream &ss) const
|
||||
{
|
||||
enum health_status_t ret(HEALTH_OK);
|
||||
|
||||
int max = mon->monmap->size();
|
||||
int actual = mon->get_quorum().size();
|
||||
if (actual < max) {
|
||||
ret = HEALTH_WARN;
|
||||
ss << (max-actual) << " mons down, quorum " << mon->get_quorum();
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -54,6 +54,7 @@ class MonmapMonitor : public PaxosService {
|
||||
bool preprocess_command(MMonCommand *m);
|
||||
bool prepare_command(MMonCommand *m);
|
||||
|
||||
enum health_status_t get_health(std::ostream &ss) const;
|
||||
|
||||
/*
|
||||
* Since monitors are pretty
|
||||
|
Loading…
Reference in New Issue
Block a user