Clean up ElectionTerm lifecycle

Description

ElectionTerm is held in RaftActorContext, but unlike similar pieces of information, it is modified via an update() method. What is worse, it also holds a reference to persistence provider, which is used via updateAndPersist() and individual behaviours.

Untangle this mess, turning ElectionTerm into a record and introducing a simple RaftActorContext.setElectionTerm() instead.

Activity

Show:

Robert Varga November 7, 2024 at 11:02 PM

Actually we need a new record, TermInfo, which holds the long+String. ElectionTerm then needs to become TermInfoStore – as that is what it is.

There is a bit of previous art – ImmutableElectionTerm is an indicator this is the case.

Also rename ElectionTermInfo to PersistenceTermInfoStore – i.e. it works with persistence.

Done

Details

Assignee

Reporter

Labels

Fix versions

Priority

Created September 19, 2024 at 1:58 PM
Updated January 28, 2025 at 4:40 PM
Resolved January 28, 2025 at 4:40 PM