}
}
+ bool need_publish = false;
/* Check for changes in pool size (if the acting set changed as a result,
* this does not matter) */
if (advmap.lastmap->get_pg_size(pg->info.pgid.pgid) !=
pg->state_set(PG_STATE_UNDERSIZED);
pg->state_set(PG_STATE_DEGRADED);
}
- pg->publish_stats_to_osd(); // degraded may have changed
+ need_publish = true; // 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 + pg->cct->_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();
+ need_publish = true;
}
+ if (need_publish)
+ pg->publish_stats_to_osd();
+
return forward_event();
}