Settings
public struct Settings
Settings generally applicable to the SWIM implementation as well as any shell running it.
-
Create default settings.
Declaration
Swift
public init()
-
Logger used by the instance and shell (unless the specific shell implementation states otherwise).
Declaration
Swift
public var logger: Logger
-
Convenience setting to change the
logger
‘s log level.Declaration
Swift
public var logLevel: Logger.Level { get set }
-
Gossip settings, configures how the protocol period time intervals and gossip characteristics.
Declaration
Swift
public var gossip: SWIMGossipSettings
-
Settings of the Lifeguard extensions to the SWIM protocol.
Declaration
Swift
public var lifeguard: SWIMLifeguardSettings
-
Configures the node of this SWIM instance explicitly, including allowing setting it’s UID.
Depending on runtime, setting this value explicitly may not be necessary, as the node can be inferred from the host/port the specific shell is bound to.
If neither, the node could be inferred, or is set explicitly, a fatal crash should be caused by the SWIM shell implementaiton.
Declaration
Swift
public var node: Node?
-
Number of indirect probes that will be issued once a direct ping probe has failed to reply in time with an ack.
In case of small clusters where nr. of neighbors is smaller than this value, the most neighbors available will be asked to issue an indirect probe. E.g. a 3 node cluster, configured with
indirectChecks = 3
has only1
remaining node it can ask for an indirect probe (since 1 node is ourselves, and 1 node is the potentially suspect node itself).Declaration
Swift
public var indirectProbeCount: Int { get set }
-
Optional feature: Set of “initial contact points” to automatically contact and join upon starting a node
Optionally, a Shell implementation MAY use this setting automatically contact a set of initial contact point nodes, allowing a new member to easily join existing clusters (e.g. if there is one “known” address to contact upon starting).
Consult your Shell implementations of frameworks’ documentation if this feature is supported, or handled in alternative ways. // TODO: This could be made more generic with “pluggable” discovery mechanism.
Note: This is sometimes also referred to “seed nodes” and a “seed node join process”.
Declaration
Swift
public var initialContactPoints: Set<ClusterMembership.Node>
-
Interval at which gossip messages should be issued. This property sets only a base value of probe interval, which will later be multiplied by
SWIM.Instance.localHealthMultiplier
.See also
maxLocalHealthMultiplier
Everyinterval
afan-out
number of gossip messages will be sent. // TODO which fanout, better docsDeclaration
Swift
public var probeInterval: DispatchTimeInterval
-
Time amount after which a sent ping without ack response is considered timed-out. This drives how a node becomes a suspect, by missing such ping/ack rounds.
This property sets only a base timeout value, which is later multiplied by
localHealthMultiplier
Note that after an initial ping/ack timeout, secondary indirect probes are issued, and only after exceedingsuspicionTimeoutPeriodsMax
shall the node be declared as.unreachable
, which results in anCluster.MemberReachabilityChange
Cluster.Event
which downing strategies may act upon.Note
Ping timeouts generally should be set as a multiple of the RTT (round-trip-time) expected in the deployment environment.
See also
SWIMLifeguardSettings.maxLocalHealthMultiplier
which affects the “effective” ping timeouts used in runtime.Declaration
Swift
public var pingTimeout: DispatchTimeInterval
-
Optional SWIM Protocol Extension:
SWIM.MemberStatus.unreachable
This is a custom extension to the standard SWIM statuses which first moves a member into unreachable state, while still trying to ping it, while awaiting for a final “mark it
.dead
now” from an external system.This allows for collaboration between external and internal monitoring systems before committing a node as
.dead
. The.unreachable
state IS gossiped throughout the cluster same as alive/suspect are, while a.dead
member is not gossiped anymore, as it is effectively removed from the membership. This allows for additional spreading of the unreachable observation throughout the cluster, as an observation, but not as an action (of removing given member).The
.unreachable
state therefore from a protocol perspective, is equivalent to a.suspect
member status.Unless you know you need unreachability, do not enable this mode, as it requires additional actions to be taken, to confirm a node as dead, complicating the failure detection and node pruning.
By default this option is disabled, and the SWIM implementation behaves same as documented in the papers, meaning that when a node remains unresponsive for an exceeded amount of time it is marked as
.dead
immediately.Declaration
Swift
public var unreachability: UnreachabilitySettings
-
Configure how unreachability should be handled by this instance.
See moreDeclaration
Swift
public enum UnreachabilitySettings
-
When enabled traces all incoming SWIM protocol communication (remote messages).
-
When enabled traces all incoming SWIM protocol communication (remote messages).
Declaration
Swift
public var traceLogLevel: Logger.Level?