Fixing test behavior to actual test what we want
We only check for last heartbeat when we get request vote when we are followers, otherwise, we can't vote while we are leaders.
Do not immediately timeout if the node has been disconnected
Better format for log
* Better log of messages
* First set the leader, then raise the event on that
* When applying commits, also raise events when apply nop command
Log when we are reverting the topology change
Handle error in events by logging them and not interrupting the state machine
Minor test optimization
Elections now run in two cycles.
First we increment the term and try to run a trial election.
Nodes can vote for multiple candidates in a trail election, but only for one in a real election (if voted for a node in a real election, they won't vote for a node in trial election for that same term).
Terms aren't incremented in trial elections.
Fixing & simplifying tests
* Removed confusion about AppendEntriesResponse.Source vs AppendEntriesResponse.From
set the commit index when installing snapshot
The next entry index after a snapshot will use the last entry index in the snapshot, rather than reset
Fixing tests
Better event names.
Will not increment term when running trial election
Removing brittle fake tests
We don't consider responses that we get from nodes outside the cluster
Fixing int64 vs int32
When we change the topology, we start processing it as soon as we accept it and process it using the _new_ topology
Adding the notion of a stepping down behavior. It will clear all the remaining events in the log, then select another node to hand over the leadership to