Pcornel
Storage · ZFS

ZIL

Cheat sheet · https://pcornel.dk/topic.php?topic=4022

Back to the Topic

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 activity
  • zfs get sync <ds> — sync policy
  • cat /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 boundaryWhat to verifyProof limit
Identity / topologyPool GUID/name, dataset/zvol, top-level vdev class, leaf-device identity and effective propertiesObject presence alone does not prove integrity, performance or recovery
Capacity / protectionPool free space, quotas/reservations, snapshot retention, redundancy and active scrub/resilver stateFree space or ONLINE state at one layer does not prove end-to-end health
Failure boundaryA 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
AcceptanceHealthy 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

Confirmation

Confirm action

Continue?