From 1569f4829de52927593a1d99a049eec01ec88ff2 Mon Sep 17 00:00:00 2001 From: Tobias Schottdorf Date: Fri, 23 Nov 2018 11:06:38 +0100 Subject: [PATCH] raft: print RejectHint of zero on MsgAppResp A zero RejectHint on MsgAppResp is still used, and so should be reflected in the message description. --- raft/util.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/raft/util.go b/raft/util.go index 79eaa0c62..c145d26dd 100644 --- a/raft/util.go +++ b/raft/util.go @@ -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)