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

Raft config update fix #364

Merged
merged 3 commits into from
Jan 11, 2021

Commits on Jan 4, 2021

  1. r/consensus: do not promote to voter if node is not in configuration

    Currently if node is no longer in configuration it may be promoted to
    voter as `raft::configuration::is_voter()` return `false` when node is
    not present in configuration - this is correct as node is not a voter.
    Added explicit check to make sure that node is part of current
    configuration before promoting it from learner to voter.
    
    Signed-off-by: Michal Maslanka <michal@vectorized.io>
    mmaslankaprv committed Jan 4, 2021
    Configuration menu
    Copy the full SHA
    876fe9e View commit details
    Browse the repository at this point in the history
  2. r/consensus: updating target_priority on learners

    Added updating `_target_priority` before skipping dispatching votes when
    node is not a voter.
    
    Learners are allowed to vote (not dispatch vote requests),
    since learner may not be updated with information that it was promoted
    while other nodes are. Learners ability to cast votes requires learners
    to update the `_target_priority` value every time leader election wasn't
    successful. The update was done when dispatching votes, but for learners
    dispatching vote was skipped, hence the `_target_priority` wasn't updated
    on learners. This might lead to situation where raft protocol couldn't
    make progress since leader election would never succeed. Fixed the issue
    by checking if node is a voter after updating `_target_priority`/
    
    Signed-off-by: Michal Maslanka <michal@vectorized.io>
    mmaslankaprv committed Jan 4, 2021
    Configuration menu
    Copy the full SHA
    b783334 View commit details
    Browse the repository at this point in the history
  3. r/tests: enabled replace_whole_group test

    After fixing vote issues during configuration update, enabled back the
    `replace_whole_group` test.
    
    Signed-off-by: Michal Maslanka <michal@vectorized.io>
    mmaslankaprv committed Jan 4, 2021
    Configuration menu
    Copy the full SHA
    69cee3d View commit details
    Browse the repository at this point in the history