-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Miscellaneous godoc and comment improvements #485
Conversation
These two functions are applying already committed logs to the FSM, so calling them apply is more consistent.
@@ -72,7 +79,7 @@ func (r *Raft) runFSM() { | |||
batchingFSM, batchingEnabled := r.fsm.(BatchingFSM) | |||
configStore, configStoreEnabled := r.fsm.(ConfigurationStore) | |||
|
|||
commitSingle := func(req *commitTuple) { | |||
applySingle := func(req *commitTuple) { |
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.
I change this function name (and applyBatch
below) because the operation it is performing is an Apply, not a commit.
err := BootstrapCluster(&cfg, r.logs, r.stable, r.snapshots, | ||
r.trans, configuration) | ||
err := BootstrapCluster(&cfg, r.logs, r.stable, r.snapshots, r.trans, configuration) |
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.
This awkward line wrapping isn't really necessary. Other lines in this file are at least this long, and many are much longer.
// current leader is being removed, it will cause a new election | ||
// to occur. This must be run on the leader or it will fail. | ||
// Use RemoveServer instead. | ||
// RemovePeer from the cluster configuration. If the current leader is being |
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 a word in first sentence?
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.
I couldn't find many examples of this style, but I think they exist somewhere. Maybe I'll stumble on them again sometime. This style uses the method name as part of the sentence, so "remove peer from the cluster configuration".
Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>
While reading the raft source code I found a number of places where the godoc or comments could be improved. I'm happy to revert or make further edits based on review feedback.
I also made a couple super minor code, which I will comment about inline.