macula_membership_member (macula v0.20.5)
View SourceMember record and state transitions for SWIM protocol. Represents a single node in the membership list.
Summary
Functions
Get address.
Compare two members to determine which is more recent. Returns: gt (M1 is newer), lt (M1 is older), eq (same)
Get incarnation number.
Mark member as alive with new incarnation (refutation). Dead members cannot be revived.
Mark member as dead (confirmed failure).
Mark member as suspect (failed to respond to ping).
Merge two member states, keeping the most recent information. Rules: 1. Dead always wins 2. Higher incarnation wins 3. Same incarnation: suspect > alive
Get metadata.
Create a new member with alive status and incarnation 0.
Create a new member with custom metadata.
Get node ID.
Get status.
Types
-type member() :: #{node_id := binary(), address := {inet:ip_address(), inet:port_number()}, status := status(), incarnation := non_neg_integer(), metadata := map()}.
-type status() :: alive | suspect | dead.
Functions
-spec address(member()) -> {inet:ip_address(), inet:port_number()}.
Get address.
Compare two members to determine which is more recent. Returns: gt (M1 is newer), lt (M1 is older), eq (same)
-spec incarnation(member()) -> non_neg_integer().
Get incarnation number.
-spec mark_alive(member(), non_neg_integer()) -> member().
Mark member as alive with new incarnation (refutation). Dead members cannot be revived.
Mark member as dead (confirmed failure).
Mark member as suspect (failed to respond to ping).
Merge two member states, keeping the most recent information. Rules: 1. Dead always wins 2. Higher incarnation wins 3. Same incarnation: suspect > alive
Get metadata.
-spec new(binary(), {inet:ip_address(), inet:port_number()}) -> member().
Create a new member with alive status and incarnation 0.
-spec new(binary(), {inet:ip_address(), inet:port_number()}, map()) -> member().
Create a new member with custom metadata.
Get node ID.
Get status.