Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • A new field committedVoterStates of type Map<Integer, ReplicaState> is added to the LeaderState class. This field stores the voter states.

  • Within the maybeUpdateHighWatermark() method, once the leader advances advance the HighWatermark, the committedVoterStates map is updated to a copy of the current active currentVoterStates. This ensures the committed voter set reflects the durable state of membership at the last committed log entry.

  • The distinction between currentVoterStates (potentially changing during ongoing elections or reconfigurations) and committedVoterStates (stable, committed membership) enables clear separation of transient membership changes from those that are confirmed and durable.

  • An accessor method committedVoterStates() is provided on LeaderState to expose this value. This method is used when constructing DescribeQuorumResponse messages to include the committed voter set, improving observability and operational diagnostics.

  • In some certain cases, like such as quorum startup and fetch or fetching snapshots, we can't get the value of committedVoterStates, at that case may not be available. In these situations, we should read the committed voter voters from the replicatedLog with epochStartOffset but using the epochStartOffset. However, since there is no information for logEndOffset, lastFetchTimestamp and lastCaughtUpTimestamp so they , or lastCaughtUpTimestamp, these fields will return their default value (of -1).

This mechanism strengthens the Raft membership model by making committed membership explicit and accessible to tooling and clients, thereby improving cluster state transparency.

...