Description
I am not using acid-state
but filing this issue because over the last 14 years, I've seen various people use it and fail because it does not actually gurantee durability (the D in "ACID").
I think it's time to point that out. I am aware of this since 2018, sorry for not filing it earier; I 5BDC find so many bugs in code I scroll by that sometimes things get lost.
The return value of fsync()
, which states whether it actually worked, is ignored:
Lines 32 to 34 in e8e50cf
I think the comment Handle error values?
is a bit ironic given that this the most important thing a library like that needs to do.
This is already bugged since 2011 (0dfb394), where it was "discovered" that without fsync()
, data may not be actually written to disk; but just calling fsync without checking that it worked doesn't do good either (e.g. the disk may be full, which may corrupt the database, and without checking fsync()
results that won't be noticed).
Since a partial write may not only impact Durability, but also Atomicity and Consistency, acid-state
is really just i-state
until that is fixed.