4 ms·
I am extremely happy to learn of Checksum VFS Shim. So this article has done its part to make the world a slightly better place. :)
by Quarrelsome 2y ago
I am extremely happy to learn of Checksum VFS Shim. So this article has done its part to make the world a slightly better place. :)
- deleted 2y ago[deleted]
- ncruces 2y agoMy Go driver adds support for this by default, and I provide a simple API to enable it. I'm of the opinion that the VFS shim should ship by default, certainly on the CLI, because it still needs to be enabled for each DB, and all it takes is one instance that doesn't know about checksums to modify a checksummed DB for it to appear corrupt. https://github.com/ncruces/go-sqlite3/tree/main/vfs#checksums https://github.com/ncruces/go-sqlite3/tree/main/vfs#checksum... Weirdly, databases created with the macOS version of the sqlite3 CLI reserve 12 bytes, for some reason, so you can't ever enable checksums on those DBs.
- ncruces 2y agoAlso, I'm not 100% certain what the interaction is between the checksums of the VFS shim and the WAL checksums during checkpointing w.r.t. silent durability loss. The shim's checksums are explicitly ignored during checkpointing so I'd need to think it through. The VFS is focused on not (silently) accepting corrupted data, not necessarily on not (silently) ignoring it.
- ncruces 2y agoYeah, I've double checked. The checksum VFS shim does nothing to fix the (silent) data loss a random bit flip in the WAL causes. If you want long term durability, checkpoint your WAL. Then the checksum VFS will help.