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 node responds to VoteRequest with outdated Term #5021
Conversation
Seems this test not always fails - Make sure you can get a green run on branch before posting PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the right thing to do? The vote response term should surely always correspond with the vote request, otherwise the vote responses may appear to be unsolicited for the new term.
Additionally, nodes receiving a vote response when in candidate state will simply ignore the response if the term is less than the current term, see L2943: if vresp.granted && nterm >= vresp.term {
Have checked this against another Raft implementation and think it's OK, will fix the test.
A node's Term may be increased during handling of a VoteRequest. When that was the case, the node was responding with a stale Term.
Signed-off-by: Neil Twigg <neil@nats.io>
80e070d
to
34d70e4
Compare
@mprimi feel free to convert from draft and will merge. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
A node's Term may be increased during handling of a VoteRequest. When that was the case, the node was responding with a stale Term.
Example trace:
This is handled correctly except VoteResponse in the last log line should be sending back Term 27, not 26.
Signed-off-by: Your Name marco@nats.io