8000 acid-state is not ACID because it ignores fsync errors · Issue #175 · acid-state/acid-state · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
acid-state is not ACID because it ignores fsync errors #175
Open
@nh2

Description

@nh2

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:

-- Handle error values?
flush :: FHandle -> IO ()
flush (FHandle (Fd c_fd)) = c_fsync c_fd >> return ()

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0