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

Reject leadership transfer requests when in candidate state #413

Merged
merged 1 commit into from
Jul 22, 2020

Conversation

briankassouf
Copy link
Contributor

@briankassouf briankassouf commented Jul 20, 2020

If raft.LeadershipTransfer().Error() is called while raft is in candidate state the caller will block until it transitions to follower or leader. If raft is in an error state and unable to elect a leader this could block indefinitely. This PR causes LeadershipTransfer() called on a candidate node to immediately return an error.

Copy link
Member

@hanshasselberg hanshasselberg left a comment

Choose a reason for hiding this comment

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

LGTM

@briankassouf briankassouf merged commit e8ce96e into master Jul 22, 2020
@briankassouf briankassouf deleted the leadership-transfer-candidate branch July 22, 2020 21:17
@Legogris
Copy link

Legogris commented Aug 5, 2020

Do I understand it right if this is a fix for hashicorp/consul#7750?

If so, is there a plan for making a new release of raft and upgrading raft in consul/nomad/vault?

We currently have a nomad cluster unoperational with the exact symptoms as the consul issue above.

UPDATE: Our incident was resolved by upgrading to raft protocol 3 from 2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants