Versions Compared

Key

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

Table of Contents

This page is meant as a template for writing a KIP. To create a KIP choose Tools->Copy on this page and modify with your content and replace the heading with the next KIP number and a description of your issue. Replace anything in italics with your own description.

Status

Current state: Under Discussion Draft

Discussion thread: here [Change the link from the KIP proposal email archive to your own email thread]

...

By maintaining a separate committedVoterSet, the system ensures:

  • Safety: Quorum checks and leader decisions are based on a membership configuration that is guaranteed to be replicated and agreed upon by a majority.

  • Stability: The committed voter set changes only at commit points, avoiding transient or rolled-back configurations.

  • Correctness under Reconfiguration: Both during joint consensus transitions and simple add/remove operations, the system preserves Raft’s safety guarantees.

Public Interfaces

Request Schema

  • Both committed and uncommitted voters participate in quorum decisions and elections. However, uncommitted voters (those whose VotersRecord has been appended but not yet committed) carry a risk: if the leader crashes before the VotersRecord is committed, the voter change maybe lost due to log truncation, leading to potential configuration inconsistencies.

  • Stability: When the committed and uncommitted voter sets differ, the cluster is in a joint consensus phase.
    Exposing this state allows management and orchestration systems to recognize that the controller quorum is undergoing a transitional reconfiguration, and to avoid assuming the new configuration is already stable.

  • Debugging and Compliance Verification: During troubleshooting or post-incident audits, operators and tools must be able to differentiate between committed voters and uncommitted voters that have started replicating but are not yet officially part of the quorum.This distinction is critical for confirming whether a reconfiguration completed successfully and whether the cluster’s control plane reached a consistent state.

Public Interfaces

Request Schema


Code Block
linenumberstrue
{
  "apiKey": 55,
Code Block
linenumberstrue
{
  "apiKey": 55,
  "type": "request",
  "listeners": ["broker", "controller"],
  "name": "DescribeQuorumRequest",
  // Version 1 adds additional fields in the response. The request is unchanged (KIP-836).
  // Version 2 adds additional fields in the response. The request is unchanged (KIP-853).
+ // Version 3 adds additional fields in the response. The request is unchanged.
+ "validVersions": "0-3",
  "flexibleVersions": "0+",
  "latestVersionUnstable": false,
  "fields": [
    { "name": "Topics", "type": "[]TopicData", "versions": "0+",
      "about": "The topics to describe.", "fields": [
      { "name": "TopicName", "type": "string", "versions": "0+", "entityType": "topicName",
        "about": "The topic name." },
      { "name": "Partitions", "type": "[]PartitionData", "versions": "0+",
        "about": "The partitions to describe.", "fields": [
        { "name": "PartitionIndex", "type": "int32", "versions": "0+",
          "about": "The partition index." }
      ]
      }]
    }
  ]
}

...

We also add new field committedVoters to QuorumInfo.


Code Block
languagejava
public class QuorumInfo {
 public class QuorumInfo {
    private final int leaderId;
    private final long leaderEpoch;
    private final long highWatermark;
    private final List<ReplicaState> voters;
+   private final intList<ReplicaState> leaderIdcommittedVoters;
    private final longList<ReplicaState> leaderEpochobservers;
    private final Map<Integer, longNode> highWatermark;
nodes;

    QuorumInfo(
        int leaderId,
      private final List<ReplicaState>long voters;
+leaderEpoch,
      private final List<ReplicaState>long committedVoters;highWatermark,
     private  final List<ReplicaState> observers;voters,
    private final Map<Integer, Node> nodes;

    QuorumInfo(List<ReplicaState> committedVoters,
        intList<ReplicaState> leaderIdobservers,
        long leaderEpochMap<Integer,
 Node>   nodes
    long) highWatermark,{
        List<ReplicaState> voters,
this.leaderId = leaderId;
        this.leaderEpoch = List<ReplicaState>leaderEpoch; committedVoters,
        this.highWatermark List<ReplicaState>= observers,highWatermark;
        Map<Integer, Node> nodes
this.voters = voters;
+       ) {this.committedVoters = committedVoters;
        this.leaderIdobservers = leaderIdobservers;
        this.leaderEpochnodes = leaderEpochnodes;
 
        this.highWatermark = highWatermark;
        this.voters = voters;
+       this.committedVoters = committedVoters;
        this.observers = observers;
        this.nodes = nodes;
    }}

Proposed Changes

Raft State Tracking

This proposal introduces a new committed voter set tracking mechanism within the LeaderState to accurately represent the last committed quorum membership.

  • 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 cases, like quorum startup and fetch snapshots, we can't get the value of committedVoterStates, at that case, we should read committed voter from replicatedLog with epochStartOffset but there is no information for logEndOffset, lastFetchTimestamp and lastCaughtUpTimestamp so they will return default value(-1).

...

   }}

Proposed Changes

Raft State Tracking

This proposal introduces a mechanism for explicit tracking the committed voter set within LeaderState. The objective is to provide an accurate representation of the last committed quorum membership.

The leaderState is extended to reference the KRaftControlRecordStateMachine, from which derives the voter set history. Using this information the of high watermark from LeaderState, the committed voter set can be obtained directly from KRaftControlRecordStateMachineBoth the voter set in the KRaftControlRecordStateMachine and the high watermark are maintained entirely in memory. This eliminates disk I/O and minimizing performance impact.

Committed voter present in current voters/observers
If a committed voter is also present in the current voters or observers set, its ReplicaState is identical to the corresponding entry in those sets. This ensures that all runtime fields within ReplicaState are available and reflect the current replica state.

Committed voter absent from voters or observers
If a committed voter is not found in either voters or observers, certain runtime-specific fields cannot be derived, since the replica is no longer actively participating in log replication. To maintain schema consistency, these fields in its ReplicaState are set to sentinel values:

  • hasAcknowledgedLeader = false
  • endLogOffset = -1

  • lastFetchTimestamp = -1

  • lastCaughtUpTimestamp = -1

Above fields are only meaningful for active replicas(voter) in the quorum. For committed voters, they are not strictly required—the sentinel values simply indicate that the data is unavailable or not applicable.

High watermark is unknown when a new leader is elected 

  • In such case, the empty set should be returned because we don't know the high watermark.
  • Committed voters can be returned as non-empty when leader update the high watermark.

Compatibility, Deprecation, and Migration Plan

  • Update Bump DescribeQuorumRequest and DescribeQuorumResponse to a newer version, with backward compatibility preserved for the old protocol version.

Test Plan

  • Unit test and integration test will be added.

Rejected Alternatives

...

  • A new field, state, can be introduced within the ReplicaState structure to explicitly track the status of the voter like uncommitted and committed.