previously, we got the mono_clock::now() in OSD::start() and passed it
to PerShardState. this worked fine. but it was a little bit convoluted
-- we pass the startup_time all the way to PerShardState.
in this change, we just use call mono_clock::now() in the contructor
of PerShardState. simpler this way.
the startup_time has two consumers:
- the PGs hosted by the sharded_service use it as a reference for the
monotonic timestamp
- Heartbeat::send_heartbeats() uses it as for the mono_ping_stamp.
because, strictly speaking, we cannot gurantee that all PerShardState
sharded services share the identical startup timestamp, as they are
constructed on different shards. but this does not matter, as PGs
always use the hosting shard service for the referencing timestamp,
and OSD always uses the shard service on local shard for sending
heartbeats.
Signed-off-by: Kefu Chai <k.chai@proxmox.com>
whoami, std::ref(*cluster_msgr), std::ref(*public_msgr),
std::ref(*monc), std::ref(*mgrc));
co_await osd_states.start();
- ceph::mono_time startup_time = ceph::mono_clock::now();
co_await shard_services.start(
std::ref(osd_singleton_state),
std::ref(pg_to_shard_mappings),
store_shards_num,
whoami,
- startup_time,
osd_singleton_state.local().perf,
osd_singleton_state.local().recoverystate_perf,
std::ref(store),
PerShardState::PerShardState(
int whoami,
- ceph::mono_time startup_time,
PerfCounters *perf,
PerfCounters *recoverystate_perf,
crimson::os::FuturizedStore &store,
// ids generated by different shards are disjoint
static_cast<ceph_tid_t>(seastar::this_shard_id()) <<
(std::numeric_limits<ceph_tid_t>::digits - 8)),
- startup_time(startup_time),
+ startup_time(ceph::mono_clock::now()),
ec_extent_cache_lru(crimson::common::local_conf().get_val<uint64_t>("ec_extent_cache_size"))
{}
public:
PerShardState(
int whoami,
- ceph::mono_time startup_time,
PerfCounters *perf,
PerfCounters *recoverystate_perf,
crimson::os::FuturizedStore &store,