This is a fully functional autopilot module extracted from Consul with a few extra improvements.
Autopilot at its core is automating raft given external knowledge of the state of the system. The automation will promote or demote servers as necessary and generally just keep the raft configuration correct as servers come and go and fail/get restored. Given that there are multiple inputs to Autopilot
The Delegate interface provides information about the applications view of known servers as well as a method for fetching server stats via some out of band mechanism.
The Raft interface (which should almost always be a Raft instance) provides the current raft configuration.
The Promoter interface abstracts away the algorithms to take the current state and determine what Raft changes should be made to bring the current state closer to the desired state.
Some follow on work for this PR:
Update the main README.md
Add some integration testing with real Raft instances as opposed to just using our mock. The first consumer of this library will be Consul which already has these integration tests but some should exist in this library itself.
This is a fully functional autopilot module extracted from Consul with a few extra improvements.
Autopilot at its core is automating raft given external knowledge of the state of the system. The automation will promote or demote servers as necessary and generally just keep the raft configuration correct as servers come and go and fail/get restored. Given that there are multiple inputs to Autopilot
Delegate
interface provides information about the applications view of known servers as well as a method for fetching server stats via some out of band mechanism.Raft
interface (which should almost always be aRaft
instance) provides the current raft configuration.Promoter
interface abstracts away the algorithms to take the current state and determine what Raft changes should be made to bring the current state closer to the desired state.Some follow on work for this PR: