ZIL
Cheat sheet · https://pcornel.dk/topic.php?topic=4022
Answer
Every writable ZFS pool has an intent-log mechanism. Synchronous operations that require stable storage are logged so they can be replayed after a crash if the normal transaction group had not yet committed them. The ZIL is not the normal destination for all writes, and in steady state it is not a general-purpose write-back cache.
Remember
- ZIL exists even without a separate SLOG.
- ZIL ≠ write cache for asynchronous writes.
- ZIL ≠ filesystem journal in the generic sense of logging every normal write.
- Successful synchronous acknowledgement ≠ application-level transaction correctness beyond the durability contract requested.
First checks
zpool iostat -v <pool> 1— log activityzfs get sync <ds>— sync policycat /proc/spl/kstat/zfs/zil— ZIL stats
Verify in this order
sync write → ZIL → ack → later TXG commit
Where it usually breaks
First mismatch in member media → metadata/layout → allocation/placement → redundancy/recovery → logical object → consumer; preserve identity/pre-state before mutation.
ZFS → ZIL ZFS map
| ZFS boundary | What to verify | Proof limit |
|---|---|---|
| Identity / topology | Pool GUID/name, dataset/zvol, top-level vdev class, leaf-device identity and effective properties | Object presence alone does not prove integrity, performance or recovery |
| Capacity / protection | Pool free space, quotas/reservations, snapshot retention, redundancy and active scrub/resilver state | Free space or ONLINE state at one layer does not prove end-to-end health |
| Failure boundary | A completed synchronous write with correct ZIL semantics proves ZFS acknowledged the requested durability boundary; it does not prove asynchronous writes were logged or the application transaction is logically valid. | Correlate ZFS evidence with both workload and lower device/path evidence |
| Acceptance | Healthy evidence: sync-heavy workload latency is explainable by stable log/pool behavior, crash recovery replays as expected, and no log-path errors are observed. | Close only after original workload plus checksum/read-back/recovery verification succeeds |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=4022