mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
raft: update lead for follower sm when receiving msgApp
Or follower may take `none` as its leader forever if it just launched a failed election whose term is the same as the current leader.
This commit is contained in:
parent
edd8d7e534
commit
690edb2c56
@ -411,6 +411,7 @@ func stepFollower(sm *stateMachine, m Message) bool {
|
||||
m.To = sm.lead.Get()
|
||||
sm.send(m)
|
||||
case msgApp:
|
||||
sm.lead.Set(m.From)
|
||||
sm.handleAppendEntries(m)
|
||||
case msgSnap:
|
||||
sm.handleSnapshot(m)
|
||||
|
Loading…
x
Reference in New Issue
Block a user