Bedrock.ControlPlane.Director.Recovery.CommitProxyStartupPhase (bedrock v0.5.2)
View SourceSolves the scalability challenge by starting commit proxy components that coordinate transaction processing across multiple distributed processes.
Commit proxies act as the critical bridge between client gateways and the core transaction system, batching requests and distributing coordination workload. Multiple proxies provide horizontal scalability—as transaction volume increases, more proxies handle the load without bottlenecks.
Uses round-robin distribution to start proxies across nodes with coordination capabilities
from context.node_capabilities.coordination, ensuring fault tolerance by spreading
proxies across different machines. Each proxy is configured with epoch and director
information for recovery coordination.
Stalls if no coordination-capable nodes are available since at least one proxy must be operational for transaction processing. Proxies remain locked until Transaction System Layout phase transitions them to operational mode.
Summary
Functions
@spec child_spec( cluster :: Bedrock.Cluster.t(), epoch :: Bedrock.epoch(), director :: pid(), lock_token :: Bedrock.lock_token(), cluster_config :: map(), instance :: non_neg_integer() ) :: Supervisor.child_spec()
@spec define_commit_proxies( n_proxies :: pos_integer(), cluster :: module(), Bedrock.epoch(), director :: pid(), available_nodes :: [node()], start_supervised :: (Supervisor.child_spec(), node() -> {:ok, pid()} | {:error, term()}), lock_token :: binary(), cluster_config :: map() ) :: {:ok, [pid()]} | {:error, {:failed_to_start, :commit_proxy, node(), reason :: term()}} | {:error, {:insufficient_nodes, :no_coordination_capable_nodes, requested :: pos_integer(), available :: non_neg_integer()}}