Skip to content

Commit

Permalink
fix formatting of raft debug log (#4090)
Browse files Browse the repository at this point in the history
Fixes this entry showing up:

```
[36571] 2023/04/22 06:53:37.278744 [DBG] RAFT [2DfzK1X6 - C-R3F-bzb7ShZ0] Stepping down from %!s(uint64=66), detected higher term: 65 vs %!d(string=leader)
```
  • Loading branch information
derekcollison committed Apr 22, 2023
2 parents 0e2eccd + d9cc8b0 commit b0d98df
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/raft.go
Expand Up @@ -3695,7 +3695,8 @@ func (n *raft) processVoteRequest(vr *voteRequest) error {
// If this is a higher term go ahead and stepdown.
if vr.term > n.term {
if n.state != Follower {
n.debug("Stepping down from %s, detected higher term: %d vs %d", vr.term, n.term, strings.ToLower(n.state.String()))
n.debug("Stepping down from %s, detected higher term: %d vs %d",
strings.ToLower(n.state.String()), vr.term, n.term)
n.stepdown.push(noLeader)
n.term = vr.term
}
Expand Down

0 comments on commit b0d98df

Please sign in to comment.