Hacker News new | ask | show | jobs
by FarmerPotato 3 hours ago
read the whole article. WAL is the transaction log and the author tested correctness after a crash.
3 comments

Well, the thing about reliability is that you can't really guarantee it by testing one particular scenario.

It seems to me that neither the old nor the new version of the code is really "durable" as I would understand the word. The old version made a write syscall per batch, but doesn't say it also did an fsync per batch. The new version writes data to an mmap'ed file, and calls fsync in the background.

So both versions are "durable" in the sense that written data is preserved even if the process gets killed, because it's in the OS page cache. But in both versions, a write can be completed before the data actually makes it to disk, so a power failure will lose acknowledged writes.

They tested SIGKILLing the process, they didn't test a power loss situation.
"Every batch of writes called file.Write on the write-ahead log"

You don't write to the WAL on a batch.

> the author tested correctness after a crash.

You mean the LLM?