The Invariants I Didn't Hold
An honest accounting of a write-ahead log: what it guarantees, where the documentation outran the code, and the pattern in every gap.
11 posts
An honest accounting of a write-ahead log: what it guarantees, where the documentation outran the code, and the pattern in every gap.
You can't unit test a power cut. What I built instead, and the gap I left in the middle of it.
Recovery isn't about salvaging as much as possible. It's about knowing exactly where you stopped believing the file.
Splitting the log into files makes almost everything easier. The seam between writing and rotating is where a durability bug was hiding.
A bounded queue forces you to decide who waits. Cancellation forces you to decide what an error means.
An honest accounting of what this job queue guarantees, what it doesn't, and the config settings that do nothing at all.
A status column records what a job was doing. It cannot record whether anyone is still doing it.
Deadlines protect the worker, not the job. Once blocking code is involved, the difference stops being academic.
Retrying is easy. Deciding when to retry, and making sure everyone doesn't decide the same thing, is the actual work.
Rooms live in memory and get thrown away. The client is the persistence layer, which changes what reconnecting means.
Every broadcast loop contains an assumption that send() works. Backpressure is what you build when it doesn't.