-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Improve raft.go
comments
#4724
Conversation
0fa835f
to
3d7e050
Compare
Signed-off-by: Neil Twigg <[email protected]>
3d7e050
to
486316b
Compare
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{} // |
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.
Missing comment?
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.
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, |
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.
Why removed? Never accessed?
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.
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") |
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.
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.
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.
Good point, I've put them back to what they were.
Signed-off-by: Neil Twigg <[email protected]>
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
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]