-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use barriers when flushing #25
Comments
In the LMDB-like case when we don't write or compute CRCs, the first barrier should be issued after writing everything but the first sector of the root block. That way, we can guarantee that the block with the newest generation is indeed a complete root block. In fact, do this unconditionally. |
Add per-flush parameters for durability. Use it in Irmin. |
Also upstream the mirage-block stuff |
Control open semantics, because some can be broken. Unix's buffering should be bypassed for example. |
The idea behind writing the header last is that the sector containing the new, highest generation number should only be written after the rest of the block is ready. Possible outcomes with an uncooperative device and an unlucky sequence of operations:
|
Follow-up to #14.
Cc @fondation451 and @samoht.
We should issue a barrier between after flushing all non-root nodes and before flushing the root node.
Then issue a second barrier after writing the root node.
If durability is desired (not just ordering), make the second barrier a durable one.
When using the Unix backend, we also need to prevent it from adding an extra layer of buffering, by passing ~buffered:false when instanciating ( https://github.com/mirage/mirage-block-unix/blob/master/lib/block.mli#L53 ).
The text was updated successfully, but these errors were encountered: