Skip to content

Commit 1912201

Browse files
committed
remove Candidate field from pre-vote request
1 parent 4f6fc13 commit 1912201

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

commands.go

-3
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,6 @@ type RequestPreVoteRequest struct {
128128
// Provide the term and our id
129129
Term uint64
130130

131-
// Deprecated: use RPCHeader.Addr instead
132-
Candidate []byte
133-
134131
// Used to ensure safety
135132
LastLogIndex uint64
136133
LastLogTerm uint64

raft.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -2059,10 +2059,8 @@ func (r *Raft) preElectSelf() <-chan *preVoteResult {
20592059
// Construct the request
20602060
lastIdx, lastTerm := r.getLastEntry()
20612061
req := &RequestPreVoteRequest{
2062-
RPCHeader: r.getRPCHeader(),
2063-
Term: newTerm,
2064-
// this is needed for retro compatibility, before RPCHeader.Addr was added
2065-
Candidate: r.trans.EncodePeer(r.localID, r.localAddr),
2062+
RPCHeader: r.getRPCHeader(),
2063+
Term: newTerm,
20662064
LastLogIndex: lastIdx,
20672065
LastLogTerm: lastTerm,
20682066
}

0 commit comments

Comments
 (0)