Bedrock.SystemKeys.ClusterBootstrap (bedrock v0.5.3)
View SourceFlatBuffer schema for cluster bootstrap info stored in object storage.
Object storage key: {cluster_name}/bootstrap
This enables coordinator-free recovery and cold start - nodes read bootstrap info from object storage to determine their role and cluster topology.
Fields
cluster_id- Unique cluster identifier (generated on first boot)epoch- Current cluster epochlogs- List of log IDs and their last known locationscoordinators- List of nodes that should run as coordinators
Example
# Encode
binary = ClusterBootstrap.to_binary(%{
cluster_id: "k7m2x9ab",
epoch: 42,
logs: [
%{id: "log-001", otp_ref: %{otp_name: "log_001", node: "node1@host"}},
%{id: "log-002", otp_ref: %{otp_name: "log_002", node: "node2@host"}}
],
coordinators: [
%{node: "node1@host"},
%{node: "node2@host"},
%{node: "node3@host"}
]
})
# Decode
{:ok, bootstrap} = ClusterBootstrap.read(binary)Boot Sequence
On node startup:
- Read ClusterBootstrap from ObjectStorage
- Check if this node is in the coordinators list
- If yes → start Coordinator process
- If no → run as worker node
On first boot (no ClusterBootstrap exists), nodes race to create an initial bootstrap using conditional PUT. The winner becomes the sole coordinator.
See Bedrock.ClusterBootstrap.Discovery for the discovery logic.