Skip to content

v0.0.5 - Manifest files & startup recovery

Latest

Choose a tag to compare

@aalhour aalhour released this 29 May 19:39
· 1 commit to main since this release
98c1c88

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-NNNNNN file
  • Crash-safe replay — startup rebuilds the active Version by 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 AddFile edits
  • 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_dump CLI for inspecting CURRENT, replaying manifest edits, and printing the reconstructed Version
  • 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