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.
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.