Implement the startup procedure:
- Read segment state from DB
- If a freeze was in progress: discard partial cold files, restart freeze
- Truncate hot segment data beyond the last committed ledger. The exact mechanism depends on the hot storage backend (flat file truncation, packfile checkpoint, or RocksDB WAL)
- Replay persisted index deltas to rebuild in-memory bitmaps and ledger offset array
- Resume accepting writes
This ticket also adds index delta persistence to the hot segment write path, which was deferred until now.
Add tests for: clean startup, crash mid-ledger, crash mid-freeze, graceful restart.
Implement the startup procedure:
This ticket also adds index delta persistence to the hot segment write path, which was deferred until now.
Add tests for: clean startup, crash mid-ledger, crash mid-freeze, graceful restart.