heartbeat
Registers node as a member of service reachable at address, serving the lease groups, or keeps it one, for ttl from now. A later heartbeat replaces the address and the groups, so a node restarted on another address is found there, and one that stops taking part in a group drops it at once. Returns or fails within ttl.
A node that crashes leaves its record behind, and a node restarted writes a new one (its id changes with each start), so a heartbeat also deletes the records of service expired for more than EXPIRED_MEMBER_TTLS times ttl, at most once per ttl for each service the store heartbeats (#6703). It does so after it wrote the node's own record, within what is left of ttl and at most a quarter of it; a delete that fails or does not answer in time is given up, and the heartbeat still returns the member it wrote. A store that does not delete them is no worse than reads that pass over expired records.