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
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/v/raft/consensus.cc
Original file line number Diff line number Diff line change
Expand Up @@ -500,8 +500,6 @@ bool consensus::should_skip_vote(bool ignore_heartbeat) {
}

skip_vote |= _vstate == vote_state::leader; // already a leader
skip_vote |= !_configuration_manager.get_latest().is_voter(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this change mean that vote_stm::vote would now allow a non-voter cast a vote?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

non-voters were always allow to cast a vote but not to request a vote. This behavior didn't change

_self); // not a voter

return skip_vote;
}
Expand Down Expand Up @@ -550,6 +548,12 @@ void consensus::dispatch_vote(bool leadership_transfer) {
// update target priority
_target_priority = next_target_priority();

// skip sending vote request if current node is not a voter
if (!_configuration_manager.get_latest().is_voter(_self)) {
arm_vote_timeout();
return;
}

// if priority is to low, skip dispatching votes, do not take priority into
// account when we transfer leadership
if (current_priority_to_low && !leadership_transfer) {
Expand Down