Aeron Cluster: Election State Machine¶ Closed FollowerReady election done connect ingress FollowerLogAwait wait for leader to connect, then record and join Log FollowerLogInit ensure Log Subscription exists with live endpoint FollowerCatchup process catchup messages, merge to live Log when near FollowerCatchupAwait wait for leader to connect, then record and join Log FollowerCatchupInit request catchup from start of leadership term FollowerReplay replay and process Log to AppendPosition FollowerLogReplication replicate missing entries from old leadership term LeaderReady wait for followers to catch up LeaderInit start recording live Log and subscribe to it replay and process Log to AppendPosition LeaderReplay await AppendPosition quorum LeaderLogReplication follower awaits election result FollowerBallot request votes, await votes, check if won CandidateBallot Nominate wait for random nomination deadline Canvass exchange AppendPositions, decide if candidate Init clear the decks Cluster Role key: Follower Leader Candidate multi node single node election timeout become candidate possible candidate become leader need to catch up in current leadership term current leadership term not started yet already exists timeout done [on RequestVote and voted for them] [on NewLeadershipTerm, needs to replicate an old leadership term] [on NewLeadershipTerm for a different logLeadershipTermId] [on NewLeadershipTerm, no Log to replicate] created Log Subscription