Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore prevote if leader lease is still valid. #366

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Jun 28, 2022

  1. Ignore prevote if leader lease is still valid.

    Suppose a raft group ng0 consists of three nodes(A(localhost:8001),
    B(localhost:8011), C(localhost:8021)), timeline is as follows: T1: A is elected
    as the leader of group ng0. term 2.  T2: Restart B.  T3: B start prevote for
    ng0, with log message node ng0:127.0.0.1:8011 term 2 start pre_vote T4: B got
    prevote grant ack from A with log message node ng0:127.0.0.1:8011:1 received
    PreVoteResponse from 127.0.0.1:8001:0 term 2 granted 1 rejected_by_lease 0
    disrupted 1 T5: B start to vote.  T6: B got vote grant ack from A. node
    ng0:127.0.0.1:8011:1 received RequestVoteResponse from 127.0.0.1:8001:0 term 3
    granted 1 rejected_by_lease 0 disrupted 1 T7: B got vote reject from C. node
    ng0:127.0.0.1:8011:1 received RequestVoteResponse from 127.0.0.1:8021:0 term 2
    granted 0 rejected_by_lease 1 disrupted 0 T8: B become the leader of ng0 with
    term 3.
    
    It's a bug that old leader A will accept the prevote and vote from reboot node B
    zhangh43 committed Jun 28, 2022
    Configuration menu
    Copy the full SHA
    ce0706b View commit details
    Browse the repository at this point in the history