OPTION(osd_mon_report_interval_max, OPT_INT, 600)
OPTION(osd_mon_report_interval_min, OPT_INT, 5) // pg stats, failures, up_thru, boot.
OPTION(osd_mon_report_max_in_flight, OPT_INT, 2) // max updates in flight
+OPTION(osd_beacon_report_interval, OPT_INT, 300) // (second) how often to send beacon message to monitor
OPTION(osd_pg_stat_report_interval_max, OPT_INT, 500) // report pg stats for any given pg at least this often
OPTION(osd_mon_ack_timeout, OPT_DOUBLE, 30.0) // time out a mon if it doesn't ack stats
OPTION(osd_stats_ack_timeout_factor, OPT_DOUBLE, 2.0) // multiples of mon_ack_timeout
#include "messages/MOSDOp.h"
#include "messages/MOSDOpReply.h"
#include "messages/MOSDBackoff.h"
+#include "messages/MOSDBeacon.h"
#include "messages/MOSDRepOp.h"
#include "messages/MOSDRepOpReply.h"
#include "messages/MOSDSubOp.h"
do_waiters();
tick_timer.add_event_after(OSD_TICK_INTERVAL, new C_Tick(this));
+
+ if (is_active()) {
+ const auto now = ceph::coarse_mono_clock::now();
+ const auto elapsed = now - last_sent_beacon;
+ if (chrono::duration_cast<chrono::seconds>(elapsed).count() >
+ cct->_conf->osd_beacon_report_interval) {
+ send_beacon(now);
+ }
+ }
}
void OSD::tick_without_osd_lock()
send_pg_stats(now);
map_lock.put_read();
+ send_beacon(ceph::coarse_mono_clock::now());
}
// full map requests may happen while active or pre-boot
osd_lock.Lock();
}
+void OSD::send_beacon(const ceph::coarse_mono_clock::time_point& now)
+{
+ dout(20) << __func__ << dendl;
+ last_sent_beacon = now;
+ const auto& monmap = monc->monmap;
+ // send beacon to mon even if we are just connected, and the monmap is not
+ // initialized yet by then.
+ if (monmap.epoch == 0 &&
+ monmap.get_required_features().contains_all(
+ ceph::features::mon::FEATURE_LUMINOUS)) {
+ monc->send_mon_message(new MOSDBeacon());
+ }
+}
void OSD::handle_command(MMonCommand *m)
{
void handle_pg_stats_ack(class MPGStatsAck *ack);
void flush_pg_stats();
+ ceph::coarse_mono_clock::time_point last_sent_beacon;
+ void send_beacon(const ceph::coarse_mono_clock::time_point& now);
+
void pg_stat_queue_enqueue(PG *pg) {
pg_stat_queue_lock.Lock();
if (pg->is_primary() && !pg->stat_queue_item.is_on_list()) {