OPTION(osd_mon_heartbeat_interval, OPT_INT, 30) // (seconds) how often to ping monitor if no peers
OPTION(osd_mon_report_interval_max, OPT_INT, 120)
OPTION(osd_mon_report_interval_min, OPT_INT, 5) // pg stats, failures, up_thru, boot.
+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_INT, 30) // time out a mon if it doesn't ack stats
OPTION(osd_default_data_pool_replay_window, OPT_INT, 45)
OPTION(osd_preserve_trimmed_log, OPT_BOOL, false)
pg_stats_publish_lock.Lock();
if (is_primary()) {
// update our stat summary
- info.stats.reported.inc(info.history.same_primary_since);
+ info.stats.reported.inc(get_osdmap()->get_epoch());
info.stats.version = info.last_update;
info.stats.created = info.history.epoch_created;
info.stats.last_scrub = info.history.last_scrub;
pg->state_set(PG_STATE_DEGRADED);
pg->publish_stats_to_osd(); // degraded may have changed
}
+
+ // if we haven't reported our PG stats in a long time, do so now.
+ if (pg->info.stats.reported.epoch + g_conf->osd_pg_stat_report_interval_max < advmap.osdmap->get_epoch()) {
+ dout(20) << "reporting stats to osd after " << (advmap.osdmap->get_epoch() - pg->info.stats.reported.epoch)
+ << " epochs" << dendl;
+ pg->publish_stats_to_osd();
+ }
+
return forward_event();
}