Merge pull request #10281 from tbg/print-hint-reject-app-resp

raft: print RejectHint of zero on MsgAppResp
This commit is contained in:
Xiang Li 2018-11-24 11:48:16 +08:00 committed by GitHub
commit 6c649de36e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)