Skip to content

v0.0.4 - Crash harness & failpoint hooks

Choose a tag to compare

@aalhour aalhour released this 19 Apr 21:38
· 9 commits to main since this release
cb57660

What's new

BeachDB now has a structured crash testing harness and an internal failpoint framework for exercising durability under process crashes and injected engine faults.

Crash harness (cmd/crash)

Replaces the previous kill-loop orchestrator with a controller/worker architecture:

  • Deterministic workloads — pre-generated from a seed, fully reproducible
  • NDJSON protocol — binary-safe controller↔worker communication over stdin/stdout
  • Oracle verification — after every crash/reopen cycle, recovered state is checked against all acknowledged operations
  • Replayable artifacts — each run writes a JSON artifact containing workload, events, cycle metadata, and any verification failure
  • Subcommands: crash run, crash replay, crash worker

Failpoint framework (internal/crashhook)

Environment-variable-armed crash and fault injection hooks wired into the engine:

  • Crash points: wal_after_append, wal_after_sync, flush_after_file_sync, flush_after_publish
  • Fault points: wal_sync_error, sst_write_error, sst_publish_error

All hook sites are marked with // FAILPOINT: <name> for grep-ability.

Other changes

  • make crash-check runs a short deterministic smoke run
  • docs/testing.md updated with harness and fault injection documentation
  • Engine-level subprocess tests for crash hooks (engine/crashhook_test.go)