DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
...
| Code Block | ||
|---|---|---|
| ||
public class QuorumInfo {
private final int leaderId;
private final long leaderEpoch;
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
) {
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 high watermark. Using this information the committed voter set can be obtained directly from KRaftControlRecordStateMachine. Both 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 = -1lastFetchTimestamp = -1lastCaughtUpTimestamp = -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:
...