LeaderForTerm

data class LeaderForTerm(val term: Long, val leaderId: NodeId)

The node §5.2 Election Safety established as the leader of term — a fact about that term, which is why the two travel together and are meaningless apart.

A bare leaderId would have to be explicitly invalidated at every site that moves the current term, and would go silently wrong the day one of them was missed. Carrying term makes staleness self-evident to the reader instead: a record whose term is not the current one simply is not this term's leader.

Constructors

Link copied to clipboard
constructor(term: Long, leaderId: NodeId)

Properties

Link copied to clipboard
Link copied to clipboard
val term: Long