Are ZIL writes (lwbs) supposed to be atomic per txg? Does ZIL-replay discard partially written txgs? #17051
-
Hi there, I'd like some help to understand the following regarding ZIL writes in a transaction group synchronization or when we do zil_commit() (due to an fsync()). However, it seems to me that the updates of single transaction group (itgx) are splitted into many lwbs right? Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
From the point of ZIL, that is sure possible that only some of lwbs issued by From the point of TXG commits (without |
Beta Was this translation helpful? Give feedback.
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 offsync()
/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…