Foundationপ্রথম নীতি থেকে
LEVEL 9 · Distributed Systems

Raft

রাফট

Consensus-কে তিন ভাগে ভেঙে বোঝার মতো ডিজাইন করা protocol — leader election + log replication + safety checks; etcd-র ইঞ্জিন।

also: raft-consensus

তিনটা subproblem, এই ক্রমেই বোঝা যায়:

1. Leader Election : term + randomized timeout + majority vote
2. Log Replication : leader-এর order-ই সত্য, AppendEntries-এ prev check
3. Safety          : election restriction + commit-এ current-term rule
  • Leader completeness: যে entry committed, সে সব ভবিষ্যৎ leader-এর log-এ থাকবে — election restriction (voter শুধু up-to-date candidate- কে vote) দিয়ে প্রমাণিত
  • Figure 8 trap: পুরনো term-এর entry leader replicate করে বসে থাকলেও নিজে থেকে commit করতে পারে না — নিজের term-এর entry-র ছায়ায় commit
  • Production presence: etcd (Kubernetes), Consul, TiKV, CockroachDB — আপনার cloud stack-এর নীচে প্রতিটা write ওই log-এই যায়