Skip to content

eileen-code4fun/SimpleRaft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SimpleRaft

This project implements a demo Raft consensus protocol. It includes all the core functions of Raft: log replication, leader election, cluster membership change. It has thorough test coverage:

# Run all the unit tests.
go test -v raft_test.go raft.go
# Run the simulation test.
go test -v -run TestEventualConsistency 

The tests may occasionally fail. That's because there is inherent randomness in Raft protocol and the tests may not have waited long enough to see the final results. Simply rerun or adjust the individual sleep timeout in the tests. That should yield a successful result.

A more elaborated blog post is written to explain the internal working of this demo implementation.

About

A simplified Golang implementation of Raft consensus protocol

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages