hashicorp / raft-autopilot

Raft Autopilot
Mozilla Public License 2.0
21 stars 5 forks source link

Allow running autopilot with reconciliation disabled on non-leaders #16

Closed mkeeler closed 2 years ago

mkeeler commented 2 years ago

The goal of this PR is to enable a mode of operation where autopilot can keep its state up to date even when running on a Raft follower. In this mode autopilot will still calculate health of other nodes and generally track servers as they come and go. What it will not do is attempt to perform any Raft operations that would alter the configuration, or request that the application remove failed servers.

Also of note is that you have to opt-in to this behavior. By default when you call Start on an Autopilot instance it will be performing both the state updating as well as the reconciliation. In order to opt-in you can pass WithReconciliationDisabled() as an option to New or you can call Autopilot.DisableReconciliation(). When a server transitions from being a follower to the leader you then call Autopilot.EnableReconciliation() to enable that functionality again.