OPTION(mon_mgr_digest_period, OPT_INT, 5) // How frequently to send digests
OPTION(mon_mgr_beacon_grace, OPT_INT, 30) // How long to wait to failover
+OPTION(mon_mgr_inactive_grace, OPT_INT, 60) // How long before health WARN -> ERR
OPTION(rgw_list_bucket_min_readahead, OPT_INT, 1000) // minimum number of entries to read from rados for bucket listing
#include "PGMonitor.h"
#include "include/stringify.h"
#include "mgr/MgrContext.h"
+#include "OSDMonitor.h"
#include "MgrMonitor.h"
dout(4) << "active server: " << map.active_addr
<< "(" << map.active_gid << ")" << dendl;
+ if (map.available) {
+ first_seen_inactive = utime_t();
+ } else {
+ first_seen_inactive = ceph_clock_now();
+ }
+
check_subs();
}
mon->timer.add_event_after(g_conf->mon_mgr_digest_period, digest_callback);
}
+void MgrMonitor::get_health(
+ list<pair<health_status_t,string> >& summary,
+ list<pair<health_status_t,string> > *detail,
+ CephContext *cct) const
+{
+ // start mgr warnings as soon as the mons and osds are all upgraded,
+ // but before the require_luminous osdmap flag is set. this way the
+ // user gets some warning before the osd flag is set and mgr is
+ // actually *required*.
+ if (!mon->monmap->get_required_features().contains_all(
+ ceph::features::mon::FEATURE_LUMINOUS) ||
+ !HAVE_FEATURE(mon->osdmon()->osdmap.get_up_osd_features(),
+ SERVER_LUMINOUS)) {
+ return;
+ }
+
+ if (!map.available) {
+ auto level = HEALTH_WARN;
+ // do not escalate to ERR if they are still upgrading to jewel.
+ if (mon->osdmon()->osdmap.test_flag(CEPH_OSDMAP_REQUIRE_LUMINOUS)) {
+ utime_t now = ceph_clock_now();
+ if (first_seen_inactive != utime_t() &&
+ now - first_seen_inactive > g_conf->mon_mgr_inactive_grace) {
+ level = HEALTH_ERR;
+ }
+ }
+ summary.push_back(make_pair(level, "no active mgr"));
+ }
+}
+
void MgrMonitor::tick()
{
if (!is_active() || !mon->is_leader())
MgrMap map;
MgrMap pending_map;
+ utime_t first_seen_inactive;
+
std::map<uint64_t, utime_t> last_beacon;
/**
void check_subs();
void send_digests();
+ void get_health(list<pair<health_status_t,string> >& summary,
+ list<pair<health_status_t,string> > *detail,
+ CephContext *cct) const override;
+
void tick() override;
void print_summary(Formatter *f, std::ostream *ss) const;