MPGStats::had_map_for was added back in
7844d0e5, the last release that
still checks this field was mimic -- monitor sends OSD incremental
osdmaps if the monitor finds that the pg_stats' had_map_for is greater
than 30 and the epoch is less than that of latest osdmap.
but DaemonServer as the new consumer of MPGStats does not check
had_map_for anymore -- it simply updates the cluster state with the
pg_stats reported by OSD. and we directs OSD to mgr for sending pg_stats
since mimic. so, we can safely drop the support of had_map_for in
octopus, as it has been 2 releases.
Signed-off-by: Kefu Chai <kchai@redhat.com>
osd_stat_t osd_stat;
map<int64_t, store_statfs_t> pool_stat;
epoch_t epoch = 0;
- utime_t had_map_for;
MPGStats() : MessageInstance(MSG_PGSTATS, 0, HEAD_VERSION, COMPAT_VERSION) {}
- MPGStats(const uuid_d& f, epoch_t e, utime_t had)
+ MPGStats(const uuid_d& f, epoch_t e)
: MessageInstance(MSG_PGSTATS, 0, HEAD_VERSION, COMPAT_VERSION),
fsid(f),
- epoch(e),
- had_map_for(had)
+ epoch(e)
{}
private:
encode(osd_stat, payload, features);
encode(pg_stat, payload);
encode(epoch, payload);
- encode(had_map_for, payload);
+ encode(utime_t{}, payload);
encode(pool_stat, payload, features);
}
void decode_payload() override {
decode(osd_stat, p);
decode(pg_stat, p);
decode(epoch, p);
- decode(had_map_for, p);
+ utime_t dummy;
+ decode(dummy, p);
if (header.version >= 2)
decode(pool_stat, p);
}
// their stats are always enqueued for sending.
RWLock::RLocker l(map_lock);
- utime_t had_for = ceph_clock_now() - had_map_since;
osd_stat_t cur_stat = service.get_osd_stat();
cur_stat.os_perf_stat = store->get_cur_stats();
- auto m = new MPGStats(monc->get_fsid(), osdmap->get_epoch(), had_for);
+ auto m = new MPGStats(monc->get_fsid(), osdmap->get_epoch());
m->osd_stat = cur_stat;
std::lock_guard lec{min_last_epoch_clean_lock};
}
}
- had_map_since = ceph_clock_now();
-
epoch_t _bind_epoch = service.get_bind_epoch();
if (osdmap->is_up(whoami) &&
osdmap->get_addrs(whoami).legacy_equals(
pool_pg_num_history_t pg_num_history;
- utime_t had_map_since;
RWLock map_lock;
list<OpRequestRef> waiting_for_osdmap;
deque<utime_t> osd_markdown_log;
void send_pg_stats() {
dout(10) << __func__
<< " pgs " << pgs.size() << " osdmap " << osdmap << dendl;
- utime_t now = ceph_clock_now();
- MPGStats *mstats = new MPGStats(monc.get_fsid(), osdmap.get_epoch(), now);
+ MPGStats *mstats = new MPGStats(monc.get_fsid(), osdmap.get_epoch());
mstats->set_tid(1);
mstats->osd_stat = osd_stat;