Skip to content

Commit

Permalink
Update godoc for Staging and Promote
Browse files Browse the repository at this point in the history
  • Loading branch information
dnephin committed Jan 17, 2022
1 parent 656e6c0 commit 08712c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
11 changes: 5 additions & 6 deletions configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ const (
// Nonvoter is a server that receives log entries but is not considered for
// elections or commitment purposes.
Nonvoter
// Staging is a server that acts like a nonvoter with one exception: once a
// staging server receives enough log entries to be sufficiently caught up to
// the leader's log, the leader will invoke a membership change to change
// the Staging server to a Voter.
// Staging is a server that acts like a Nonvoter. A configuration change
// with a ConfigurationChangeCommand of Promote can change a Staging server
// into a Voter.
Staging
)

Expand Down Expand Up @@ -95,8 +94,8 @@ const (
DemoteVoter
// RemoveServer removes a server entirely from the cluster membership.
RemoveServer
// Promote is created automatically by a leader; it turns a Staging server
// into a Voter.
// Promote changes a server from Staging to Voter. The command will be a
// no-op if the server is not Staging.
Promote
)

Expand Down
4 changes: 1 addition & 3 deletions raft.go
Original file line number Diff line number Diff line change
Expand Up @@ -1370,9 +1370,7 @@ func (r *Raft) appendEntries(rpc RPC, a *AppendEntriesRequest) {
return
}
if entry.Term != storeEntry.Term {
r.logger.Warn("clearing log suffix",
"from", entry.Index,
"to", lastLogIdx)
r.logger.Warn("clearing log suffix", "from", entry.Index, "to", lastLogIdx)
if err := r.logs.DeleteRange(entry.Index, lastLogIdx); err != nil {
r.logger.Error("failed to clear log suffix", "error", err)
return
Expand Down

0 comments on commit 08712c3

Please sign in to comment.