Skip to content

Election optimization #229

Open
Open

Description

@zavier-wong
  • Pre-Vote
  • Check Quorum
  • Leader Lease

Activity

  1. jovany-wang commented on Jul 30, 2022

    @jovany-wang
    Collaborator

    Thanks for the proposals. Maybe it's better to left the details on how we should implement them?

  2. zavier-wong commented on Aug 1, 2022

    @zavier-wong
    ContributorAuthor

    The specific process of the PreVote stage is to send a PreVote message to all nodes before initiating the real election (not much different from the actual voting message, but it will not automatically increase its own term), and the node that receives the message agrees to the conditions for re-election Yes:

    1. The term of the PreCandidate node is larger, or the term is the same but the log index is larger;
    2. The leader's heartbeat has not been received within at least one election timeout period;

    Only when more than half of the nodes agree to PreVote, the node can self-increase the term to initiate a real election and send a RequestVote request.

  3. zavier-wong commented on Aug 1, 2022

    @zavier-wong
    ContributorAuthor

    Check Quorum is a mechanism for leaders to step down. The leader node sends a message to check whether it maintains more than half of the connections with other nodes in the cluster. If not, it becomes a follower node.

  4. zavier-wong commented on Aug 1, 2022

    @zavier-wong
    ContributorAuthor

    The leader lease mechanism means that the node will not vote for other nodes within an election timeout period when the node receives a message from the leader.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions