Sequencer Startup
View SourceStarting the global version authority that ensures transaction ordering consistency.
The Sequencer serves as Bedrock's singular source of truth for version assignment across the entire cluster. During recovery, establishing this global version authority is critical because all transaction processing depends on having unique, monotonically increasing version numbers.
Why a Single Sequencer?
Version assignment requires exactly one authority cluster-wide. Multiple sequencers would create irreconcilable conflicts—imagine two sequencers simultaneously assigning version 1001 to different transactions. This architectural constraint trades theoretical availability for practical consistency, eliminating complex consensus protocols while ensuring proper MVCC semantics.
Startup Process
The sequencer starts on the director's node using the recovery baseline from log recovery planning. This initialization preserves three critical properties:
- Continuity: New versions begin exactly where the old system left off
- Uniqueness: No previously assigned version numbers get reused
- Causality: The Lamport clock sequence remains intact across recovery
Failure Handling
Sequencer startup failure triggers immediate recovery termination because version assignment is an absolute prerequisite for transaction processing. When the sequencer cannot start on the director's own node, it indicates fundamental problems:
- Resource exhaustion preventing initialization
- OTP supervision tree issues
- Network configuration or process registration conflicts
Rather than attempting repairs, recovery terminates immediately—better to restart with a clean epoch than deploy an unreliable version authority.
Integration with Transaction Pipeline
Once operational, the sequencer coordinates with other components through its three version counters:
- Commit proxies request version assignments for transaction batches
- Links obtain read versions for consistent snapshots
- Storage servers organize MVCC data structures using the version timeline
This creates system-wide synchronization where all components operate from a shared understanding of transaction ordering.
Next Phase
With version authority established, recovery continues to Commit Proxy Startup to deploy the horizontally scalable commit processing components.
Implementation: lib/bedrock/control_plane/director/recovery/sequencer_startup_phase.ex