mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
raft: Ignore redundant addNode calls.
This avoids clobbering any state when bootstrapping entries are applied twice.
This commit is contained in:
parent
3d91faf85a
commit
ea4d645a83
@ -472,6 +472,12 @@ func (r *raft) handleSnapshot(m pb.Message) {
|
||||
func (r *raft) resetPendingConf() { r.pendingConf = false }
|
||||
|
||||
func (r *raft) addNode(id uint64) {
|
||||
if _, ok := r.prs[id]; ok {
|
||||
// Ignore any redundant addNode calls (which can happen because the
|
||||
// initial bootstrapping entries are applied twice).
|
||||
return
|
||||
}
|
||||
|
||||
r.setProgress(id, 0, r.raftLog.lastIndex()+1)
|
||||
r.pendingConf = false
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user