Settings

Theme

Raft Consensus in 2k Words

news.alvaroduran.com

4 points by ohduran 2 months ago · 5 comments

Reader

BinaryIgor 2 months ago

Great write-up - what I would add is that this algorithm rest on the assumption that all nodes are behaving honestly and are not malicious. Which of course is true for most distributed systems we build, but is not true for public blockchains, like Bitcoin for example :)

BinaryIgor 2 months ago

Curious about this piece:

"By up-to-date, I mean that the follower will grant its vote only if the candidate’s last entry term (included in the RequestVote) is higher, or the candidate’s last entry index (also included) is higher for the same term. If the candidate’s log isn’t more up-to-date than the follower’s, the latter won’t grant its vote."

Is this why election timeouts are random? To guarantee that at least one candidate is more up-to-date than others, as measured by the last entry term?

  • ohduranOP 2 months ago

    Election timeout is random to prevent split votes. The up-to-date restriction ensures that you can only get elected if you're ahead, which, combined with the requirement to gather the votes of the majority of the votes, ensures that the leader has all committed entries.

    Check section 5.4.3 in the paper, where it proves it quite elegantly IMHO: https://raft.github.io/raft.pdf

negrel 2 months ago

As someone not that familiar with the subject, I found it easy to follow. Thanks.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection