Versions Compared

Key

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

...

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

  1. An existing cluster
    • 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.

  2. A Single Node Initialized with Dynamic Voters
    • 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.

  3. A Single Node Initialized with Static Voters
    • 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.

      • If hasHistoryUpdated is false, the static voter set is returned.

...

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