News for hackers. Stuff that matters.
Re:PSA: SQLite WAL checksums fail silently and may lose data by grumbelbart2 on Friday July 25, 2025 @07:04AM (#44681830)
Just wondering how SQLite would ever work if it had zero control over this. Surely there must be some "flush" operation that guarantees that everthing so far is written to disk? Otherwise, any "old" block that contains data might have not been written. SQLite says:

> Local devices also have a characteristic which is critical for enabling database management software to be designed to ensure ACID behavior: When all process writes to the device have completed, (when POSIX fsync() or Windows FlushFileBuffers() calls return), the filesystem then either has stored the "written" data or will do so before storing any subsequently written data.

Re:PSA: SQLite WAL checksums fail silently and may lose data by mschuster91 on Friday July 25, 2025 @07:09AM (#44681862)
A "flush" command does indeed exist... but disk and controller vendors are like patients in Dr. House [1] - everybody lies. Especially if there are benchmarks to be "optimized". Other people here have written up that better than I ever could [2].

[1] https://house.fandom.com/wiki/Everybody_lies

[2] https://news.ycombinator.com/item?id=30371403