|
|
Subscribe / Log in / New account

Files are hard

Files are hard

Posted Sep 26, 2019 17:20 UTC (Thu) by rweikusat2 (subscriber, #117920)
In reply to: Files are hard by psoberoi
Parent article: Better guidance for database developers

I'd rather call this a great example of how people who don't understand what they're talking about can end up producing loads and loads of gibberish, ex all the talk about "reordering". That's a term someone lifted from machine code execution and applied here to mean "what happened wasn't what I expected to happen !!!1". But that's entirely the fault of this person: By default, all writes to any file system end up in the page cache which does write-behind caching of "disk writes". Consequently, there's absolutely no correlation between an ordering of write system calls on different file descriptors and and a later ordering of "disk writes" flushing dirty pages: That's an inherent property of this kind of caching scheme which has existed since some time in the 1970s.

Moving forward along these lines, fsync is not "a barrier and a flush operation", it's a forced writeback of a part of the page cache. Obviously, updates to the page cache after an fsync won't end up being written prior to the writeback forced by the fsync because - duh! - that has already happened. It's not because there's some kind of "reordering" fsync prevents.


to post comments


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds