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

[DRAFT] Raft Improvements #5951

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

[DRAFT] Raft Improvements #5951

wants to merge 6 commits into from

Conversation

ReubenMathew
Copy link
Contributor

@ReubenMathew ReubenMathew commented Oct 1, 2024

DRAFT

@ReubenMathew ReubenMathew requested a review from a team as a code owner October 1, 2024 21:53
@ReubenMathew ReubenMathew changed the title rmn/raft improvements [DRAFT] rmn/raft improvements Oct 1, 2024
server/raft.go Outdated
@@ -3619,6 +3613,17 @@ func (n *raft) processAppendEntryResponse(ar *appendEntryResponse) {
n.stepdownLocked(noLeader)
n.Unlock()
arPool.Put(ar)
return
} else if ar.term < n.term {
Copy link
Member

Choose a reason for hiding this comment

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

Don't need this else, just normal if here since you return from the previous block.

@bruth
Copy link
Member

bruth commented Oct 2, 2024

@ReubenMathew it would be helpful to share a short summary of what the change addresses.

Signed-off-by: reubenninan <reuben@nats.io>
No need to set term if granting vote since receiving a request with a higher or lower term is handled earlier in this method.

Signed-off-by: reubenninan <reuben@nats.io>
@ReubenMathew
Copy link
Contributor Author

@ReubenMathew it would be helpful to share a short summary of what the change addresses.

I am still chewing on one of the changes; the one related to AppendEntries response handling is theoretically correct, but it's breaking a lot of unit tests. There's some behavior I'm not accounting for...

I will update the PR and take it out of draft when I figure it out.

@ReubenMathew ReubenMathew marked this pull request as draft October 2, 2024 02:11
@ReubenMathew ReubenMathew changed the title [DRAFT] rmn/raft improvements [DRAFT] Raft Improvements Oct 2, 2024
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