reckon_db_store_coordinator (reckon_db v1.2.7)
View SourceStore coordinator for reckon-db
Coordinates cluster join operations and prevents split-brain scenarios.
Responsibilities: - Detecting existing clusters via RPC - Coordinator election (lowest node name) - Coordinated cluster joining - Split-brain prevention
Summary
Functions
Check if this node is the leader
Join the Khepri cluster using coordinated approach
Join a specific node's cluster
Get current leader node
Get cluster members
Check if this node should handle nodeup events
Types
-type store_config() :: #store_config{store_id :: atom(), data_dir :: string(), mode :: single | cluster, timeout :: pos_integer(), writer_pool_size :: pos_integer(), reader_pool_size :: pos_integer(), gateway_pool_size :: pos_integer(), options :: map()}.
Functions
Check if this node is the leader
-spec join_cluster(atom()) -> ok | coordinator | no_nodes | waiting | failed.
Join the Khepri cluster using coordinated approach
Join a specific node's cluster
Get current leader node
Get cluster members
Check if this node should handle nodeup events
-spec start_link(store_config()) -> {ok, pid()} | {error, term()}.