- https://raft.github.io/
- https://raft.github.io/raft.pdf
- https://github.com/ongardie/dissertation/blob/master/stanford.pdf
- https://github.com/lni/awesome-consensus
- https://github.com/maemual/raft-zh_cn/blob/master/raft-zh_cn.md 中文
- https://github.com/etcd-io/etcd/tree/main/raft
- https://github.com/hashicorp/raft
- https://github.com/lni/dragonboat
- https://github.com/eliben/raft
- https://github.com/goraft/raft
- https://github.com/ongardie/raft.tla/blob/master/raft.tla
- https://raw.githubusercontent.com/logcabin/logcabin/master/Protocol/Raft.proto
- https://thesquareplanet.com/blog/raft-qa/
- https://zhuanlan.zhihu.com/p/33816607 论文翻译
- https://zhuanlan.zhihu.com/p/26506491 UncP
- https://www.zhihu.com/people/wo-zuo-fen-bu-shi-xi-tong/posts 我做分布式数据库
- https://eli.thegreenplace.net/2020/implementing-raft-part-0-introduction/
- http://blog.fnil.net/posts/2016-12-25-ac1fa10ff9b2404ed0b91bdfaf76a87d/
- http://blog.fnil.net/posts/2016-10-12-255ccfae971d6d30b0921120d327490b/
- https://www.zhihu.com/question/382888510 为什么 Raft 的 ApplyIndex 和 CommitIndex 不需要持久化?
- https://www.zhihu.com/question/68287713
- https://github.com/etcd-io/etcd/blob/main/raft/README.md
- https://github.com/lni/dragonboat-example
- https://github.com/hashicorp/raft-boltdb
- https://github.com/hashicorp/raft/tree/main/docs
- https://github.com/hashicorp/raft/blob/main/docs/apply.md
- https://github.com/otoolep/hraftd hashicorp
- https://github.com/yusufsyaifudin/raft-sample hashicorp
- https://github.com/moby/swarmkit/blob/master/design/raft.md
- https://github.com/nvanbenschoten/rafttoy
- https://github.com/otoolep/hraftd
- https://github.com/jabolina/go-smr
- https://github.com/siddontang/rust-raftkv
- async-raft/async-raft#130
- https://github.com/datafuselabs/databend/tree/82e6e4c909306f6a4676fe693ddf5f4edcf6ad60/metasrv/src
- https://github.com/bullfrog-store/bullfrogkv
- https://github.com/nvanbenschoten/rafttoy
- https://github.com/matrixorigin/matrixcube
- https://github.com/tidwall/uhaha
- https://github.com/CodeTiger927/Dragonboat-Experiment
Ed Huang
对分布式系统学习还是有点心得,理论基础要打牢。
从存储系统入手,Google 的老三篇入门,最好能顺手把 6.824 做了,不难, 智商正常的本科生都能做完,另外推荐一本书 Distributed systems for fun and profit
做完 6.824 后就可以从复制协议开始入手,Paxos 的几篇,Lamport 那篇有空膜拜一下好了, 真正有价值的是 Paxos made live / Paxos made simple 那几篇,然后可以深入看看 Raft, 这个在 6.824 里面会用到。
我做分布式数据库
这个实现还可以继续简化,Raft 核心可以看成四种相对独立状态机, RPC 和别的各类事件都可以统一看成是状态机的消息输入,每个单独的 RPC 不应该有预期回复, 而应该看成单向的消息传递。
Raft 本身可以抽象为状态机,比如可以看成 membership, core, flow control, application RSM 四个状态机, 外部所有的 RPC、定时事件(心跳选举)都可看成是状态机收到消息以后做出反应。可以看看 etcd 的 raft 实现, 我自己做的和 etcd 的 Raft 都是这样实现的。
commit index 可以从多数派恢复,也就是 n/2+1
个节点的最小日志 index,所以不需要持久化。