Repository navigation
What's new
BeachDB now has a durable manifest layer. Instead of discovering SSTables by scanning the database directory, the engine records file-set changes in an append-only MANIFEST log and reconstructs the current storage state on startup.
Manifest files
- VersionEdit log — records SSTable additions, deletions, file-number state, sequence state, and WAL metadata
- CURRENT pointer — atomically identifies the live
MANIFEST-NNNNNNfile - Crash-safe replay — startup rebuilds the active
Versionby replaying manifest edits in order - Trailing truncation handling — incomplete final manifest records are treated as recoverable crash tails
- Corruption detection — bad magic, checksum mismatches, unknown tags, and missing referenced SSTables fail loudly
Engine recovery
DB.Open()now restores SSTable inventory from the manifest- Flushes durably publish new SSTables through manifest
AddFileedits - Orphan SSTables are ignored and cleaned up when they were written but never published
- File IDs and sequence counters survive restart through manifest state
Tooling and docs
- New
manifest_dumpCLI for inspectingCURRENT, replaying manifest edits, and printing the reconstructedVersion - Manifest format documentation in
docs/formats/manifest.md - Manifest example under
examples/engine/manifest - Expanded engine and manifest recovery tests
Internal cleanup
- Shared record framing moved into
internal/record - WAL and MANIFEST records now use distinct 8-byte magic values
- Filesystem durability helpers moved into
internal/fs - SST footer layout constants and WAL layout constants make on-disk formats easier to audit
What's not in this release
- Manifest rotation
- Compaction
- Merge iterators and snapshot reads
- Bloom filters or block cache