ExESDB.ClusterCoordinator (ex_esdb v0.0.20)

GenServer responsible for coordinating Khepri cluster formation and preventing split-brain scenarios.

This module handles:

  • Detecting existing clusters
  • Coordinator election
  • Coordinated cluster joining
  • Split-brain prevention

Summary

Functions

Returns a specification to start this module under a supervisor.

Attempts to join a Khepri cluster using coordinated approach to prevent split-brain. Returns one of: :ok, :coordinator, :no_nodes, :waiting, :failed

Checks if this node should handle nodeup events (i.e., not already in a cluster)

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

join_cluster(store)

Attempts to join a Khepri cluster using coordinated approach to prevent split-brain. Returns one of: :ok, :coordinator, :no_nodes, :waiting, :failed

should_handle_nodeup?(store)

Checks if this node should handle nodeup events (i.e., not already in a cluster)

start_link(opts)