goraft/raft — pull request #167 by xiangli-cmu (2014-01-24 09:45:56+00:00)
Title: more safty

Get the term before we check the state.
We are not able to stop the heartbeat right after the state changes for now.

This ensure the safety.
With this change, I run raft-bench for tens millions of logs without a problem.

I am aware of this might be kind of heck, and am going to refactor the whole process when I have time.