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 certain cases, such as quorum startup or fetching snapshots, the value of committedVoterStates may not be available. When handling a DescribeQuorumRequest in these situations, we should read the committed voters from the replicatedLog using the replicatedLog#startOffsetreplicatedLog#highWatermark. However, since there is no information for logEndOffset, lastFetchTimestamp, 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.

...