partisan_peer_discovery_agent behaviour (partisan v6.3.0)
View SourceThis state machine polls a discovery backend (the callback module) and joins the peers it reports.
A discovery answer is a hint for joining, never a membership authority: the agent only ever adds peers, through partisan_peer_service:add_members/1. A member the backend stops reporting stays a member; a node leaves the cluster only through partisan_peer_service:leave/0,1. The reason is that every backend answers from a readiness- or health-gated, eventually consistent source (DNS, an orchestrator's endpoint list), which omits a node that is booting or briefly unhealthy. Treating that omission as a departure removed the node from the membership and gossiped the removal, and the node then shut its own peer service down on receiving it ("membership doesn't contain us") — once per poll, for as long as it stayed out of the answer. Pinned by partisan_peer_discovery_agent_test and partisan_SUITE:discovery_never_evicts_test/1.
Summary
Functions
In this state the agent uses the callback module to discover peers by calling its lookup/2 callback.
Callbacks
Functions
-spec disable() -> ok.
-spec enable() -> ok.
In this state the agent uses the callback module to discover peers by calling its lookup/2 callback.
-spec status() -> enabled | disabled.