Skip to content

Instantly share code, notes, and snippets.

@dcorbacho
Created December 7, 2017 14:54
Show Gist options
  • Save dcorbacho/6159033fe7bee4a9f1e638a4006593a4 to your computer and use it in GitHub Desktop.
Save dcorbacho/6159033fe7bee4a9f1e638a4006593a4 to your computer and use it in GitHub Desktop.

ra_log_file:write/2 thows an integrity_error -> shouldn't it return {queued, State}?

ra_log_file:write/2 allows to write sequences with missing indexes if they're in the middle of the list provided. If it's the first one missing, then integrity_error. It should verify every entry ra_log_file:take/3 crashes badly when the sequence is missing some indexes. This wouldn't happen if the previous one was working properly, but we also get a crash when we ask for an out of bounds range, i.e {-53, 10}. It should be a controlled error.

write/2 accepts initial index as 0, while append/2 starts in 1. <- inconsistent!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment