Skip to content

Are ZIL writes (lwbs) supposed to be atomic per txg? Does ZIL-replay discard partially written txgs? #17051

Answered by amotin
dgiantsidi asked this question in Q&A
Discussion options

You must be logged in to vote

From the point of ZIL, that is sure possible that only some of lwbs issued by fsync()/zil_commit() are written before the crash. And on a following import only what was written will be replayed, that might split some write operation. But in that case the caller of fsync()/zil_commit() should not get the function return before the crash, so there is no valid contract yet. fsync() does not promise anything until it returns.

From the point of TXG commits (without fsync()) writes might actually be more atomic, since writes up to a certain size might be assigned to one TXG and so committed or not atomically, but those guaranties are just a ZFS internal implementation details and not exposed ex…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@dgiantsidi
Comment options

Answer selected by dgiantsidi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants