bbengfort / cloudscope

Simulation and visualization of distributed systems and communications.
http://bbengfort.github.io/cloudscope/
MIT License
1 stars 0 forks source link

log index out of order #90

Closed bbengfort closed 7 years ago

bbengfort commented 7 years ago

When adding outages I noticed that leaders weren't gracefully bringing followers up to date. There were a variety of errors mostly index errors.

The solution was to capture index errors at the source then report them more completely. There were two primary issues:

  1. My reading of "If an existing entry conflicts with a new one (same index but different terms), delete the existing entry and all that follow it" was incorrect, I was comparing the previous log entry not the current entry.

  2. Log truncation should occur on heartbeats, not just if entries are sent.

There is still the possibility that out of order append entries arrive, in this case I'm just dropping the append entries for now.

bbengfort commented 7 years ago

@KonstantinosX Thanks for helping me fix this!