Re:Consensus Is Harder Than It Looks (2020)
by kilotaras on Thursday February 11, 2021 @05:03AM
(#26099910)
I'm not sure if you are aware of it, but check out MIT 6.824 on opencourseware (pick 2020, not 2021).
In Lab 2 they provide you with a frame for raft with RPC, etc. already in place leaving only protocol for you. Lab is also split into 3 logical parts - leader election, append entries, persistence. Highly recommend.
Re:Consensus Is Harder Than It Looks (2020)
by ignoramous on Thursday February 11, 2021 @07:18AM
(#26100684)
You are not alone: https://news.ycombinator.com/item?id=23123701 and https://youtu.be/QVvFVwyElLY?t=2502
Like TFA points out, distributed consensus is punishingly hard. AWS relied on TLA+ to prove consensus in DynamoDB and other systems https://lamport.azurewebsites.net/tla/formal-methods-amazon....
Interestingly, Kinesis [0] and SQS (?) avoid consensus for those same reasons.
Re:Consensus Is Harder Than It Looks (2020)
by mjb on Thursday February 11, 2021 @10:26AM
(#26102441)
Chain Replication (and friends) are vastly simpler than Paxos (and friends) in many ways, but do have the same requirement for determinism. That's because chain replicated systems typically need to be confluent (see https://pathelland.substack.com/p/dont-get-stuck-in-the-con-...), which means that all the replicas need to have the same value in them when replication is done. Conceptually simpler, for sure, but many of the same challenges remain.
Re:Consensus Is Harder Than It Looks (2020)
by ZephyrBlu on Thursday February 11, 2021 @06:52AM
(#26100545)
How did you know there were still concurrency issues? I would expect issues like that to be relatively subtle.
Did you build out a test suite?
Re:Consensus Is Harder Than It Looks (2020)
by jerf on Thursday February 11, 2021 @09:34AM
(#26101848)
Heh... knowing for certain that you've gotten all the concurrency issues is hard. Knowing that a specific code base has concurrency issues can be very easy, by virtue of them clearly exhibiting bugs. I haven't tried to implement RAFT myself but I've certainly had code bases that clearly had concurrency bugs in them, even if I didn't know exactly what they were. :)
I tried implementing Raft, which is supposed to be the most understandable out of all available consensus algorithms, but wasn't able to make it work 100%.
I came close but in the end gave up on resolving some concurrency issues :/