News for hackers. Stuff that matters.
Re:What's So Bad About Posix I/O? by convolvatron on Monday September 11, 2017 @09:55PM (#15224164)
the atomic write business is pretty painful in any distributed setting, and only comes into play with concurrent writers with overlapping byte offset regions.

I've always kind of struggled to imagine a case where an application would be correct with this guarantee and faulty otherwise. i guess some sort of cleverly designed structure with fixed length records where a compound mutation could be expressed in a contiguous byte range?

Re:What's So Bad About Posix I/O? by glennklockwood on Tuesday September 12, 2017 @11:25AM (#15228032)
There are very few cases in practice where it's needed. The bigger issue is deciding what consistency semantics you _do_ want to have once you decide that strong isn't necessary. Every decision exposes another corner case where someone's application breaks.
Re:What's So Bad About Posix I/O? by Derbasti on Tuesday September 12, 2017 @01:43AM (#15225063)
Imagine two processes appending rows to a csv file. If writes were non-atomic, they might insert partial rows, or overwrite each other.
Re:What's So Bad About Posix I/O? by convolvatron on Tuesday September 12, 2017 @01:49AM (#15225088)
the append case is actually different, it requires serializing the end of file pointer.

in the write atomicity case we're asking the file system to order all the writes, and make sure the resulting file shows each of them being completed in their entirety before the next is applied, without any interleaving even if they refer to the same byte offsets in the file

Re:What's So Bad About Posix I/O? by jstimpfle on Monday September 11, 2017 @10:22PM (#15224260)
Aren't these atomic writes only a reflection of the fact that data is written out as blocks?
Re:What's So Bad About Posix I/O? by convolvatron on Monday September 11, 2017 @11:18PM (#15224564)
well, yeah, it wouldn't otherwise be necessary for the writes to be fully serialized (because blocks and the cache traditionally, but really anything)

edit: its also worth noting that even in the traditional implementation since the block interface doesn't provide atomicity on faults this is kinda probabilistic anyways