Skip to content

Commit

Permalink
raft: print RejectHint of zero on MsgAppResp
Browse files Browse the repository at this point in the history
A zero RejectHint on MsgAppResp is still used, and so should be
reflected in the message description.
  • Loading branch information
tbg committed Nov 23, 2018
1 parent 02a9810 commit 1569f48
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions raft/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,7 @@ func DescribeMessage(m pb.Message, f EntryFormatter) string {
var buf bytes.Buffer
fmt.Fprintf(&buf, "%x->%x %v Term:%d Log:%d/%d", m.From, m.To, m.Type, m.Term, m.LogTerm, m.Index)
if m.Reject {
fmt.Fprintf(&buf, " Rejected")
if m.RejectHint != 0 {
fmt.Fprintf(&buf, "(Hint:%d)", m.RejectHint)
}
fmt.Fprintf(&buf, " Rejected (Hint: %d)", m.RejectHint)
}
if m.Commit != 0 {
fmt.Fprintf(&buf, " Commit:%d", m.Commit)
Expand Down

0 comments on commit 1569f48

Please sign in to comment.