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.
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
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
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?