hn.today

Nightmare mode: simulating disk failures

antithesis.com3 points0 comments
Screenshot of Nightmare mode: simulating disk failures

Reliable storage systems must cope not only with crashes but also with full disks, failed writes, filesystem limits, slow operations, and data that reaches storage only partially or out of order. Antithesis developed “nightmare mode” fault injection so customers can test these conditions in distributed-system simulations, recognizing that filesystems and applications make different assumptions. The central challenge is reproducing a power failure: killing an application leaves the kernel running, so its page cache and background writeback can preserve unsynced data. Antithesis first adapted LazyFS, a FUSE-based filesystem that keeps unsynced writes in a controllable userspace cache, allowing the simulator to discard them during a simulated power loss. It later built Amnesia, a faster Rust-based FUSE filesystem that tracks files by inode and keeps both volatile and durable states in memory.

The system also injects I/O errors and explores how they affect filesystem state, not just what error a syscall returns. A key example is EIO from fsync: Linux may mark pages clean before the device confirms writes, so after a failed fsync, retrying can succeed even though the data was never saved. This behavior underlies the fsyncgate bug and led PostgreSQL to crash and recover from its log rather than retry a failed fsync. The work also exposed torn writes and reordered persistence, and the broader fault-injection effort aims to test space-reclamation logic and concurrency bugs caused by disk latency. Together, these simulations reveal storage failures that ordinary process-kill testing misses.

Read on antithesis.com0 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Other

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.