View Source ProcessHub.Strategy.PartitionTolerance.StaticQuorum (ProcessHub v0.4.1-beta)

The static quorum strategy provides partition tolerance through a fixed minimum node count.

This strategy is ideal for clusters that:

  • Have a known, fixed cluster size
  • Need explicit control over partition behavior
  • Do not dynamically scale up or down
  • Require predictable quorum requirements

How It Works

The static quorum strategy requires a minimum number of nodes (:quorum_size) to be present in the cluster for it to operate. When the number of nodes falls below this threshold, the cluster enters partition mode and terminates the distributed supervisor along with all child processes.

Behavior on Node Changes

Node leaves cluster:

  • If remaining nodes >= :quorum_size: cluster continues operating
  • If remaining nodes < :quorum_size: cluster enters partition mode

Node joins cluster:

  • If total nodes >= :quorum_size: cluster exits partition mode (if it was in one)
  • If total nodes < :quorum_size: cluster remains in partition mode

Split-Brain Protection

If you have a 5-node cluster with quorum_size: 3 and it splits into partitions of 3 and 2:

  • The partition with 3 nodes maintains quorum and continues operating
  • The partition with 2 nodes loses quorum and enters partition mode

Configuration

partition_tolerance_strategy: %ProcessHub.Strategy.PartitionTolerance.StaticQuorum{
  quorum_size: 3,           # Required: minimum nodes needed
  startup_confirm: false    # Optional: check quorum at startup (default: false)
}

Options

  • quorum_size - Required. The minimum number of nodes that must be present in the cluster for it to operate. Must be a positive integer.

  • startup_confirm - Optional. If set to true, the hub will check if quorum is met when starting up. If quorum is not met at startup, the cluster immediately enters partition mode. Default: false (allows startup with any number of nodes).

Important Considerations

Startup Behavior

With startup_confirm: false (default):

  • The cluster starts regardless of current node count
  • Partition checking begins when nodes join or leave
  • This allows starting nodes before the full cluster is formed

With startup_confirm: true:

  • The cluster immediately enters partition mode if current nodes < quorum_size
  • Use this when you want strict quorum enforcement from the start

Scaling Considerations

This strategy is not suitable for clusters that scale dynamically. If your cluster size changes over time, consider using:

Summary

Types

t()

Static quorum strategy configuration.

Types

@type t() :: %ProcessHub.Strategy.PartitionTolerance.StaticQuorum{
  quorum_size: non_neg_integer(),
  startup_confirm: boolean()
}

Static quorum strategy configuration.

  • quorum_size - The quorum size is measured in the number of nodes. For example, 3 means that there should be at least 3 nodes in the cluster for the ProcessHub to be considered healthy.
  • startup_confirm - If set to true, the ProcessHub will check if the quorum is present when the ProcessHub is starting up. If the quorum is not present, it will be considered as a network partition. The default value is false.