Explorar o código

raft: fix print format for term in one log line

`term` should be printed in decimal representation instead of
hexadecimal one.
Yicheng Qin %!s(int64=10) %!d(string=hai) anos
pai
achega
3a65442d7d
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      raft/raft.go

+ 1 - 1
raft/raft.go

@@ -627,7 +627,7 @@ func stepCandidate(r *raft, m pb.Message) {
 		r.becomeFollower(m.Term, m.From)
 		r.handleSnapshot(m)
 	case pb.MsgVote:
-		r.logger.Infof("%x [logterm: %d, index: %d, vote: %x] rejected vote from %x [logterm: %d, index: %d] at term %x",
+		r.logger.Infof("%x [logterm: %d, index: %d, vote: %x] rejected vote from %x [logterm: %d, index: %d] at term %d",
 			r.id, r.raftLog.lastTerm(), r.raftLog.lastIndex(), r.Vote, m.From, m.LogTerm, m.Index, r.Term)
 		r.send(pb.Message{To: m.From, Type: pb.MsgVoteResp, Reject: true})
 	case pb.MsgVoteResp: