←back to thread

275 points whatisabcdefgh | 6 comments | | HN request time: 0s | source | bottom
Show context
lifthrasiir ◴[] No.45134401[source]
SQLite can't be reliably used in networked file systems because it heavily relies on locking to be correctly implemented. I recently had to add a check for such file systems in my application [1] because I noticed a related corruption firsthand. Simpler file formats do not demand such requirements. SQLite is certainly good, but not for this use.

[1] https://github.com/lifthrasiir/angel/commit/50a15e703ef2c1af...

replies(4): >>45134413 #>>45135134 #>>45135346 #>>45135619 #
1. greenavocado ◴[] No.45134413[source]
Easy fix is an empty lock file adjacent to the real one.
replies(1): >>45134419 #
2. lifthrasiir ◴[] No.45134419[source]
Yeah, but only if SQLite did support that mode in some built-in VFS implementation...
replies(1): >>45134841 #
3. hedora ◴[] No.45134841[source]
Which network filesystems are still corrupting sqlite files?

Sqlite on NFSv3 has been rock solid for some NFS servers for a decade.

Maybe name and shame?

replies(1): >>45135307 #
4. lifthrasiir ◴[] No.45135307{3}[source]
Specifically I had an issue over 9p used by WSL2. (I never thought it was networked before this incident.)
replies(1): >>45151333 #
5. hedora ◴[] No.45151333{4}[source]
It seems odd to break a wide range of valid configs for something so obscure.
replies(1): >>45155150 #
6. lifthrasiir ◴[] No.45155150{5}[source]
Yes, that was surprising to me too! I was able to fairly reliably reproduce data corruption in this case.