Skip to content

embeage/6.824-raft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MIT 6.824 Raft

Implementation of the Raft consensus algorithm (see the extended Raft paper). Based on the MIT 6.824 Distributed Systems lab. Runs by the way of the tester, go test.

Implements the core parts of the paper, as well as snapshotting. Also includes a few optimizations such as the accelerated log backtracking described on page 7-8. The Raft code is divided into clear sections reflecting parts of the paper and is commented thoroughly. It features an easy to understand design, with two long-running goroutines alive simultaneously during the lifetime of a node. The applier goroutine will run through the course of the node, while the election timeout goroutine will be swapped with the heartbeats goroutine when becoming leader and vice-versa when stepping down. AppendEntries are sent out on each heartbeat, but can optionally be sent on each appended log entry to the leader if desired. This will reduce the real time performance at the cost of CPU time.

Test results (500 iterations)

  • 2A Leader Election
  • 2B Log
  • 2C Persistance
  • 2D Log compaction

About

Raft consensus algorithm. Based on MIT 6.824.

Topics

Resources

License

Stars

Watchers

Forks

Languages