Report a sequence number when we flush_pg_stats. Combine the up_from and
a per-boot seq number to get a monotonically increasing value across OSD
restarts (we assume less than 4 billion stats reports in a single epoch).
Signed-off-by: Sage Weil <sage@redhat.com>
else if (prefix == "flush_pg_stats") {
if (osdmap->require_osd_release >= CEPH_RELEASE_LUMINOUS) {
mgrc.send_pgstats();
+ ds << service.get_osd_stat_seq() << "\n";
} else {
flush_pg_stats();
}
// -- stats --
Mutex stat_lock;
osd_stat_t osd_stat;
+ uint32_t seq = 0;
void update_osd_stat(vector<int>& hb_peers);
osd_stat_t get_osd_stat() {
Mutex::Locker l(stat_lock);
+ ++seq;
osd_stat.up_from = up_epoch;
- ++osd_stat.seq;
+ osd_stat.seq = ((uint64_t)osd_stat.up_from << 32) + seq;
return osd_stat;
}
+ uint64_t get_osd_stat_seq() {
+ Mutex::Locker l(stat_lock);
+ return osd_stat.seq;
+ }
// -- OSD Full Status --
private: