View Source partisan_membership_set (partisan v5.0.0-beta.13)
This module represents the cluster membership view for this node.
When a node joins the cluster it is added to the set. Conversely when a node leaves the cluster it is removed from the set. A node that crashes or gets disconnected will remain in the set so that Partisan can try to re-connect with the node when it restarts or becomes reachable again.
implementation
Implementation
The set is implemented as a CRDT set of node_spec()
objects. More specifically a state_orset.
Notice that because the set stores node_spec()
objects and not node()
, the set can have multiple node_spec()
objects for the same node.
This can occur when the set contains one or more stale specifications.
stale-specifications
Stale Specifications
A stale specification exists due to the following reasons:
- A node crashes (without leaving the cluster) and returns bearing different IP Addresses (the value of the node specification's
listen_addrs
property). This is common in cloud orchestration scenarios where instances have dynamic IP addresses. - A node crashes (without leaving the cluster) and returns bearing different values for the node specification properties
channels
and/orparallelism
. For example, this can happen in the case the Partisan configuration has changed when using a rolling update strategy i.e. a gradual update process that allows you to update a cluster one node at a time to minimise downtime.
Link to this section Summary
Link to this section Types
-type actor() :: binary().
-type channel() :: atom().
-type listen_addr() :: #{ip => inet:ip_address(), port => non_neg_integer()}.
-type node_spec() :: #{name => node(), listen_addrs => [listen_addr()], channels => [channel()], parallelism => non_neg_integer()}.
-opaque t()