]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
crimson/osd: init PerShardState::startup_time per-shard 69329/head
authorKefu Chai <k.chai@proxmox.com>
Mon, 8 Jun 2026 09:17:26 +0000 (17:17 +0800)
committerKefu Chai <k.chai@proxmox.com>
Tue, 9 Jun 2026 07:30:29 +0000 (15:30 +0800)
commit1879f2470b70f58e7d68408671faaea7b950a575
tree64beb52e86a37f12f4d224acae30e3e41f85a67a
parentacbfd2de97254f97bd098e83a94c5819adcc34d1
crimson/osd: init PerShardState::startup_time per-shard

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>
src/crimson/osd/osd.cc
src/crimson/osd/shard_services.cc
src/crimson/osd/shard_services.h