Repository navigation
Phoenix Protocol
The Phoenix Protocol is the chunk-load recovery subsystem of the Colossus Core Engine. Its primary responsibility is to detect and reconcile missing or incomplete lock records when a Minecraft chunk becomes available.
Phoenix operates across SASL's hybrid persistence architecture, examining chunk-level Persistent Data Container (PDC) records and physical TileState metadata to restore lock information to the active storage layer.
Rather than relying on a snapshot rollback mechanism, Phoenix reconstructs missing runtime and repository records from the persistent data that is still available.
Phoenix is activated through the chunk-load event and processes eligible chunks through a controlled recovery pipeline.
Its recovery process combines several data sources:
- Chunk PDC: Reads serialized lock records stored across multiple PDC pages.
- TileState PDC: Provides a physical metadata fallback when the corresponding chunk-level ownership information is unavailable.
- Lock Repository: Reconciles recovered records with the central persistence layer.
- Runtime Cache: Restores recovered locks to the active in-memory lock registry.
This approach allows SASL to recover certain missing runtime or repository records without requiring manual re-registration.
When a chunk becomes available, Phoenix follows a structured recovery sequence:
Phoenix validates the incoming chunk reference and identifies its world and coordinates.
Before processing begins, it checks relevant operational conditions, including:
- Pending PDC writes.
- Active migration operations.
- Chunk maintenance status.
- Supported world environment.
- Recent recovery activity.
A debounce mechanism prevents the same chunk from being repeatedly processed within a short interval.
Phoenix reads the chunk's primary PDC entry and its additional data pages.
It also inspects eligible TileState entities to identify lockable blocks and locate ownership metadata that may not be available in the chunk-level records.
When chunk-level ownership data cannot provide the required information, Phoenix checks the block's TileState PDC.
If valid lock metadata is found, Phoenix can use it to reconstruct the corresponding ownership and expiration information.
Recovered physical metadata can also be written back into the chunk-level PDC layer.
Serialized chunk records are parsed asynchronously to reduce the amount of intensive processing performed directly during the chunk-load operation.
Phoenix processes the parsed records in batches of 500 entries.
The resulting batches are dispatched to the server's main thread for world and block validation, preventing unsafe Bukkit world modifications from being performed asynchronously.
Before restoring a record, Phoenix validates its target coordinates and checks whether the corresponding chunk and lockable block are available.
It then reconciles missing repository information and restores the appropriate runtime lock-cache entries.
When repository data is modified, the repository is marked dirty and an asynchronous save is requested.
- Chunk PDC Recovery: Reads serialized lock information from the chunk's primary PDC entry and additional pages.
- TileState Fallback: Retrieves ownership and expiration metadata directly from physical block metadata when necessary.
- Batch Processing: Separates asynchronous record parsing from main-thread world operations.
- Repository Reconciliation: Restores missing persistence records through the central LockRepository.
- Runtime Cache Restoration: Re-registers recovered locks in the active lock cache.
- Migration Protection: Avoids interfering with active bulk migration and migration-engine operations.
- Debounce Protection: Prevents repeated recovery attempts against the same chunk within the configured cooldown period.
Phoenix uses configurable limits to control its recovery workload.
| Parameter | Default Value | Purpose |
|---|---|---|
phoenix-debounce-ms |
10000 ms | Minimum interval between recovery attempts for the same chunk |
phoenix-tile-limit |
5000 | Configured tile-entity processing threshold |
phoenix-pdc-parse-limit |
2000 | Maximum serialized PDC entries parsed per recovery pass |
phoenix-player-radar-enabled |
true | Enables the player-activity chunk radar |
The tile-entity threshold can also be adjusted dynamically according to server conditions.
When the player radar is enabled, normal recovery processing can be restricted to chunks associated with active player locations. Startup processing follows a separate condition.
These controls help prevent excessive recovery workloads during chunk loading.
Warning
Recovery Scope: Phoenix reconstructs lock metadata using information available in SASL's persistent storage layers. It cannot guarantee recovery when the required ownership and lock information has been permanently removed from all available sources.
Important
World Compatibility: In the current implementation, Nether and End chunks are excluded from the Phoenix recovery pipeline. The supported recovery environment is the Overworld.
Note
Thread Safety: PDC parsing is performed asynchronously, while world and block validation and repository reconciliation are dispatched through the server's main thread.
Caution
Recovery Is Not Snapshot Rollback: Phoenix does not implement historical snapshot restoration, header-checksum verification, or general-purpose corrupted-sector reconstruction.
Phoenix works alongside the other Colossus subsystems:
- Argus: Evaluates lock integrity and identifies suspicious or stale records.
- Phoenix: Recovers and reconciles available persistent lock metadata during chunk loading.
- Executioner: Handles the final purge workflow for records selected for removal.
- Dreadnought: Protects migration operations from conflicting recovery activity.
- Maximus: Maintains cache and temporary-state cleanup operations.
Each subsystem has a distinct responsibility within the Colossus Core Engine.
Architected by Protocol-S Development
Lead Architect: RunningArmy6