←back to thread

275 points whatisabcdefgh | 3 comments | | HN request time: 0s | source
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 #
greenavocado ◴[] No.45134413[source]
Easy fix is an empty lock file adjacent to the real one.
replies(1): >>45134419 #
lifthrasiir ◴[] No.45134419[source]
Yeah, but only if SQLite did support that mode in some built-in VFS implementation...
replies(1): >>45134841 #
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 #
1. lifthrasiir ◴[] No.45135307[source]
Specifically I had an issue over 9p used by WSL2. (I never thought it was networked before this incident.)
replies(1): >>45151333 #
2. hedora ◴[] No.45151333[source]
It seems odd to break a wide range of valid configs for something so obscure.
replies(1): >>45155150 #
3. lifthrasiir ◴[] No.45155150[source]
Yes, that was surprising to me too! I was able to fairly reliably reproduce data corruption in this case.