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: Draft

...

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,
  "type
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 additional fields in the response. The request is unchanged.
+ "validVersions": "0-3",
  "flexibleVersions": "0+",
      "aboutlatestVersionUnstable": "The topics to describe.", false,
  "fields": [
      { "name": "TopicNameTopics", "type": "string[]TopicData", "versions": "0+", "entityType": "topicName",
        "about": "The topics topicto namedescribe." },, "fields": [
      { "name": "PartitionsTopicName", "type": "[]PartitionDatastring", "versions": "0+", "entityType": "topicName",
        "about": "The partitionstopic to describename.", "fields": [
   },
      { "name": "PartitionIndexPartitions", "type": "int32[]PartitionData", "versions": "0+",
          "about": "The partitions partitionto indexdescribe." }
      ]
      }]
    }
  ]
}

Response Schema

Code Block
linenumberstrue
{
  "apiKey": 55,
 , "fields": [
        { "name": "PartitionIndex", "type": "responseint32",
  "nameversions": "DescribeQuorumResponse0+",
  //   Version 1 adds LastFetchTimeStamp and "about": "The partition index." }
      ]
      }]
    }
  ]
}

Response Schema


Code Block
linenumberstrue
{
  "apiKey": 55,
  "type": "responseLastCaughtUpTimestamp in ReplicaState (KIP-836).
  // Version 2 adds ErrorMessage, Nodes, ErrorMessage in ParitionData, ReplicaDirectoryId in ReplicaState (KIP-853).
+ // Version 3 adds CommittedVoters in PartitionData
+ "validVersions": "0-3",
  "flexibleVersionsname": "0+DescribeQuorumResponse",
  "fields": [
    { "name": "ErrorCode", "type": "int16", "versions": "0+",
      "about": "The top level error code."},
    { "name": "ErrorMessage", "type": "string", "versions": "2+", "nullableVersions": "2+", "ignorable": true,
      "about": "The error message, or null if there was no error." },
    { "name": "Topics", "type": "[]TopicData// Version 1 adds LastFetchTimeStamp and LastCaughtUpTimestamp in ReplicaState (KIP-836).
  // Version 2 adds ErrorMessage, Nodes, ErrorMessage in ParitionData, ReplicaDirectoryId in ReplicaState (KIP-853).
+ // Version 3 adds CommittedVoters in PartitionData
+ "validVersions": "0-3",
  "flexibleVersions": "0+",
  "fields": [
    { "name": "ErrorCode", "type": "int16", "versions": "0+",
      "versionsabout": "0+", "fields": [
  The top level error code."},
    { "name": "TopicNameErrorMessage", "type": "string", "versions": "02+", "entityTypenullableVersions": "topicName",
        "about": "The topic name"2+", "ignorable": true,
      "about": "The error message, or null if there was no error." },
      { "name": "PartitionsTopics", "type": "[]PartitionDataTopicData",
        "versions": "0+", "fields": [
        { "name": "PartitionIndexTopicName", "type": "int32string", "versions": "0+",
 "entityType": "topicName",
        "about": "The partitiontopic indexname." },
        { "name": "ErrorCodePartitions", "type": "int16","[]PartitionData",
        "versions": "0+"}, "fields": [
        { "name": "ErrorMessagePartitionIndex", "type": "stringint32", "versions": "20+",
          "nullableVersionsabout": "2+", "ignorable": trueThe partition index." },
        {  "aboutname": "ErrorCode"The error message, or null if there was no error."  "type": "int16", "versions": "0+"},
        { "name": "LeaderIdErrorMessage", "type": "int32string", "versions": "02+", "entityTypenullableVersions": "brokerId"2+", "ignorable": true,
          "about": "The ID of the current leadererror message, or -1null if thethere leaderwas isno unknownerror." },
        { "name": "LeaderEpochLeaderId", "type": "int32", "versions": "0+", "entityType": "brokerId",
          "about": "The latestID knownof leader epoch"},
        { "name": "HighWatermark", "type": "int64", "versions": "0+the current leader or -1 if the leader is unknown."},
        { "name": "CurrentVotersLeaderEpoch", "type": "[]ReplicaStateint32", "versions": "0+" },
+       { "name": "CommittedVoters", "type": "[]ReplicaState", "versions": "3+", "ignorable": true , "about":  "The voterslatest hasknown beenleader committed.epoch"},
        { "name": "ObserversHighWatermark", "type": "[]ReplicaStateint64", "versions": "0+" },
      ]}
    ]},
    { "name": "NodesCurrentVoters", "type": "[]NodeReplicaState", "versions": "20+" }, "fields": [

+       { "name": "CommittedVoters",  {"type": "[]ReplicaState", "nameversions": "NodeId3+", "typeignorable": true "int32", "versionsabout": "2+" "The voters has been committed."},
        { "mapKeyname": true"Observers", "entityTypetype": "brokerId[]ReplicaState", "aboutversions": "The ID of the associated node" },
  "0+" }
      ]}
    ]},
    { "name": "ListenersNodes", "type": "[]ListenerNode",
        "about": "The listeners of this controller", "versions": "2+", "fields": [
        { "name": "NameNodeId", "type": "stringint32", "versions": "2+",
        "mapKey": true,
          "entityType": "brokerId", "about": "The nameID of the associated endpointnode" },
        { "name": "HostListeners", "type": "string[]Listener", "versions": "2+",

        "about": "The listeners of this controller", "aboutversions": "2+"The, hostname"fields": },[
        { "name": "PortName", "type": "uint16string", "versions": "2+",
          "aboutmapKey": "The port" }true,
      ]}
    ]}
  ],
  "commonStructs"about": [
"The name of  { "name": "ReplicaState", "versions": "0+", "fields": [
the endpoint" },
        { "name": "ReplicaIdHost", "type": "int32string", "versions": "02+",
 "entityType": "brokerId" },
      { "nameabout": "ReplicaDirectoryId",The hostname"type": "uuid", "versions": "2+" },
 },
         { "name": "LogEndOffsetPort", "type": "int64uint16", "versions": "02+",
          "about": "The lastport" known}
 log end offset of the follower]}
 or -1 if it]}
 is unknown"}],
  "commonStructs": [
    { "name": "LastFetchTimestamp", "type": "int64", "versions": "1+"ReplicaState", "ignorableversions": true"0+", "defaultfields": -1,[
      {  "aboutname": "ReplicaId"The last known leader wall clock time time when a follower fetched from the leader. This is reported as -1 both for the current leader or if it is unknown for a voter", "type": "int32", "versions": "0+", "entityType": "brokerId" },
      { "name": "ReplicaDirectoryId", "type": "uuid", "versions": "2+" },
      { "name": "LastCaughtUpTimestampLogEndOffset", "type": "int64", "versions": "10+", "ignorable": true, "default": -1,
        "about": "The leader wall clock append time of the offset for which the follower made the most recent fetch request. This is reported as the current time for the leader and "about": "The last known log end offset of the follower or -1 if unknown for a voter"}
    ]}
  ]
}

We also add new field committedVoters to QuorumInfo.

Code Block
languagejava
public class QuorumInfo {
    private final int leaderId;it is unknown"},
      { "name": "LastFetchTimestamp", "type": "int64", "versions": "1+", "ignorable": true, "default": -1,
    private final long  "about": "The last known leader wall clock time time when a follower fetched from the leader. This is reported as -1 both for the current leader or if it is unknown for a voter"},
      { "name": "LastCaughtUpTimestamp", "type": "int64", "versions": "1+", "ignorable": true, "default": -1,
        "about": "The leader wall clock append time of the offset for which the follower made the most recent fetch request. This is reported as the current time for the leader and -1 if unknown for a voter"}
    ]}
  ]
}

We also add new field committedVoters to QuorumInfo.


Code Block
languagejava
public class QuorumInfoleaderEpoch;
    private final long highWatermark;
    private final List<ReplicaState> voters;
+   private final List<ReplicaState> committedVoters;
    private final List<ReplicaState> observers;
    private final Map<Integer, Node> nodes;

    QuorumInfo(
        int leaderId,
        long leaderEpoch,
        long highWatermark,
        List<ReplicaState> voters,
        List<ReplicaState> committedVoters,
        List<ReplicaState> observers,
        Map<Integer, Node> nodes
    ) {
    private    this.leaderId =final int leaderId;
    private    this.leaderEpoch =final long leaderEpoch; 
    private final   this.highWatermark = long highWatermark;
    private final List<ReplicaState>  this.voters = voters;
+   private final  List<ReplicaState> this.committedVoters = committedVoters;
        this.observers = observers;
  ;
    private final this.nodes = nodesList<ReplicaState> observers;
     }}

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 high watermark. Using this information 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, there by, minimizing performance impact.

Semantic

The relationship between voters and committed voters is defined as follows:

Committed voter present in 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.Committed voter absent from voters or observers 

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:

  • endLogOffset = -1

  • lastFetchTimestamp = -1

  • lastCaughtUpTimestamp = -1

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

Benefit

This mechanism strengthens the Raft membership model by:

  • Making committed membership explicit.

  • Providing a consistent interface for tooling and client introspection.

  • Improving the overall transparency and debuggability of the cluster state.

  • Reducing performance overhead by avoiding disk operations, since all required voter state and high watermark data are memory-resident.

Case Study: Voter Status Scenarios

When considering voter status, the following scenarios should be addressed:

...

  • This is the most common scenario.

  • The cluster already contains a snapshot that includes the voter set record.

  • In this case, voters can be retrieved directly from the KRaftControlStateMachine.

...

  • After initialization, the node generates a 0-0.checkpoint file.

  • Similar to the existing cluster case, voters can be obtained directly from the checkpoint through the KRaftControlStateMachine.

...

private final Map<Integer, Node> nodes;

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

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

...

This is a special case that requires additional handling.

...

A flag hasHistoryUpdated is introduced to VoterSetHistory, with its initial value set to false.

...

When the votersHistory is updated, this flag is set to true.

Retrieval logic:

...

If hasHistoryUpdated is true, the voter set is returned from votersHistory.

...

  • .

Compatibility, Deprecation, and Migration Plan

...