From: Sage Weil Date: Mon, 16 May 2011 20:42:31 +0000 (-0700) Subject: mon: health WARN if monitor quorum is incomplete X-Git-Tag: v0.28~20 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3865ca568864ca033c5df647263e08694270210d;p=ceph.git mon: health WARN if monitor quorum is incomplete Signed-off-by: Sage Weil --- diff --git a/src/mon/MonmapMonitor.cc b/src/mon/MonmapMonitor.cc index 39f9cc84c8020..496e6071fde4c 100644 --- a/src/mon/MonmapMonitor.cc +++ b/src/mon/MonmapMonitor.cc @@ -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; +} diff --git a/src/mon/MonmapMonitor.h b/src/mon/MonmapMonitor.h index 58f28441ccf1b..406dcc96df7f7 100644 --- a/src/mon/MonmapMonitor.h +++ b/src/mon/MonmapMonitor.h @@ -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