goraft / raft

UNMAINTAINED: A Go implementation of the Raft distributed consensus protocol.
MIT License
2.43k stars 479 forks source link

fix peer ae.response bug #162

Closed xiang90 closed 10 years ago

xiang90 commented 10 years ago

If the peer return a high term, we should not update its previous index. The previous index might larger than the index of this "leader" (it is not leader any more), since the new leader might have successfully append logs to that peer.

If we update the index, panic will happen: https://github.com/goraft/raft/blob/master/log.go#L254

I think the panic is correct.

benbjohnson commented 10 years ago

@xiangli-cmu It looks like the build is failing now:

https://drone.io/github.com/goraft/raft/15

Can you fix that?

xiang90 commented 10 years ago

@benbjohnson sure.