Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-9876 Implement Raft Protocol for Metadata Quorum
  3. KAFKA-10661

Add resigned state to raft state machine to preserve leader/epoch information

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • None
    • None

    Description

      While working on KAFKA-10655, I realized we have a bug in the existing raft state initialization logic when the process shuts down as leader. After reinitializing, we retain the current epoch, but we discard the current leader status. This means that it is possible for the node to vote for another node in the same epoch that it was the leader of.

      To fix this problem I think we should add a separate "resigned" state. When re-initializing after being shutdown as leader, we can enter the "resigned" state. This prevents us from voting for another candidate while still ensuring that a new election needs to be held.

      Attachments

        Issue Links

          Activity

            People

              hachikuji Jason Gustafson
              hachikuji Jason Gustafson
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: