News for hackers. Stuff that matters.
Re:Files Are Hard (2015) by jng on Sunday December 01, 2019 @01:47PM (#21677080)
Rename is the most atomic you can get on Unix. Original article talks about partial file updates. New SQLITE file + rename should be as failproof as possible. And I’m any case nothing is 100% safe, so redundancy is a hard requirement for real safety.
Re:Files Are Hard (2015) by waterhouse on Sunday December 01, 2019 @02:41PM (#21677388)
I've encountered one gotcha there: SQLite operations may create "-journal" files, and you may have to be careful exactly what files you're copying or moving around.

More: https://sqlite.org/howtocorrupt.html , https://sqlite.org/tempfiles.html

Re:Files Are Hard (2015) by Hackbraten on Sunday December 01, 2019 @02:49PM (#21677422)
I was referring to the last section of the article, the part where it says rename isn’t atomic on crashes. Why not migrate traditionally via DDL in a transaction?
Re:Files Are Hard (2015) by mehrdadn on Sunday December 01, 2019 @04:11PM (#21677803)
It's not clear to me if they're correct about that. The way it's written, it seems to be saying "my read of the POSIX standard suggests rename may not be atomic on crashes", rather than "there are POSIX implementations in common use that have been observed to have non-atomic renames on crashes".