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

Improve raft.go comments #4724

Merged
merged 2 commits into from
Nov 9, 2023
Merged

Improve raft.go comments #4724

merged 2 commits into from
Nov 9, 2023

Conversation

neilalexander
Copy link
Member

This PR mostly just tries to comment what is going on inside raft.go and does odd little bits of housekeeping/cleanup in places.

Signed-off-by: Neil Twigg [email protected]

Signed-off-by: Neil Twigg <[email protected]>
@neilalexander neilalexander marked this pull request as ready for review November 9, 2023 12:05
@neilalexander neilalexander requested a review from a team as a code owner November 9, 2023 12:05
server/raft.go Outdated
qn int // Number of nodes needed to establish quorum
peers map[string]*lps // Other peers in the Raft group

removed map[string]struct{} //
Copy link
Member

Choose a reason for hiding this comment

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

Missing comment?

Copy link
Member Author

Choose a reason for hiding this comment

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

Forgot to fill those in, have done so now.

@@ -380,7 +376,6 @@ func (s *Server) startRaftNode(accName string, cfg *RaftConfig, labels pprofLabe
track: cfg.Track,
csz: ps.clusterSize,
qn: ps.clusterSize/2 + 1,
hash: hash,
Copy link
Member

Choose a reason for hiding this comment

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

Why removed? Never accessed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, it was never used.

server/raft.go Outdated
@@ -819,7 +859,7 @@ func (n *raft) PauseApply() error {
n.stepdown.push(noLeader)
}

n.debug("Pausing our apply channel")
n.debug("Pausing our apply queue")
Copy link
Member

Choose a reason for hiding this comment

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

These are tough, sometimes easy to see a better log line but if its out there folks could depend on it, so I usually shy away from changing.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, I've put them back to what they were.

server/raft.go Outdated Show resolved Hide resolved
Signed-off-by: Neil Twigg <[email protected]>
Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

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

LGTM

@neilalexander neilalexander merged commit 495eb03 into main Nov 9, 2023
4 checks passed
@neilalexander neilalexander deleted the neil/raftdocs branch November 9, 2023 13:40
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.

2 participants