ServiceMembership
One node's membership in its service on one lease store: a single record, heartbeated every ClusterOptions.heartbeatInterval, listing the lease groups the node takes part in, and a single read of the service's live members every ClusterOptions.reconcileInterval (or ClusterOptions.routeRefreshInterval, the shorter), which every PartitionOwnership of the node reuses for its reconcile and its routes instead of reading its own. The store operations of membership so stay constant in the number of lease groups: a heartbeat and a read per node and interval, where each group used to heartbeat, and read its members twice, on its own.
An ownership joins with its group and leaves it; the record lists the groups joined and not stuck. A change of that list is heartbeated at once, so the other nodes see a group left (a graceful stop, a failed start, a stuck reconcile) as soon as they saw it before, when each group had its own record: HRW still counts, per group, the members that list it. The membership starts with its first group and leaves the service, at once, with its last.
A loop of the membership that ends on an error no round catches (NodeLoops.kt) is not restarted, and its end ends the node's part in the service on this store: without heartbeats the other nodes no longer count it, and without reads it no longer sees who serves a group. The membership then calls the store no more for what ended (the record expires on its own, the members stay as last read), joins no group, and tells each group it serves (whenEnded), which steps out, rather than renew a share no other node can reach or take.
Constructors
Properties
Functions
Stops taking part in group: heartbeats the record without it at once, or, for the last group, leaves the service and stops the heartbeats and the reads. The group leaves the record's list before the store is called, so no heartbeat lists it again, even one that waits on the store meanwhile; a leave of a group left already, one whose call was cancelled say, still brings the record and the heartbeats in line.