3 ms·
A better abstraction, designed from the ground up, wouldn’t force fsyncs to work. For example, write groups or barriers (like memory barriers) would be wonderf
by josephg 2y ago
A better abstraction, designed from the ground up, wouldn’t force fsyncs to work.
For example, write groups or barriers (like memory barriers) would be wonderful. Or a transaction api, or io completion ports like on windows.
In a database (and any other software designed for resiliency), you want the file contents to transition cleanly from state A to B to C, with no chance to end up in some intermediate state in the case of power loss. And you want to be notified when the data has durably written. It’s unnecessarily difficult to write code that does that on top of POSIX in an efficient way. Most code that interacts with files is either slow, wrong or both. All because the api is bad.