POSIX semantics and ZFS on synchronous + asynchronous writes #17149
-
Hello, ZFS (ZIL) does not guarantee any ordering between asynchronous and synchronous Example to clarify my understanding:
By reading the ZIL code it seems that When we do the Is my understanding correct? Shouldn't a read always see the latest write? In case of a crash the latest write appears to be Thanks again, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
The answer is inside
The moment you open file with |
Beta Was this translation helpful? Give feedback.
-
Hi @amotin , Okay, thank you! What you are saying makes sense! I am working on a previous version (tag: 2.2.4) which has slightly a different implementation for zfs_open() and zfs_write() that was why I was confused. For example, zfs_open increases the counter (so z_sync_cnt != 0, when we open the file with O_SYNC)
But when we write (zfs_write -> zfs_log_write) all itx are by default sync (itx_sync = B_TRUE), unless we enter this piece of code.
However, yes, in the current version, it does make sense. |
Beta Was this translation helpful? Give feedback.
Hi @amotin ,
Okay, thank you! What you are saying makes sense!
I am working on a previous version (tag: 2.2.4) which has slightly a different implementation for zfs_open() and zfs_write() that was why I was confused.
For example, zfs_open increases the counter (so z_sync_cnt != 0, when we open the file with O_SYNC)
But when we write (zfs_write -> zfs_log_write) all itx are by default sync (itx_sync = B_TRUE), unless we enter this piece of code.
So I do not see how we serialize the writes correctly here.