Filesystem Journals and Recovery Boundaries

Group related metadata changes into an ordered journal transaction and reason about which transactions recovery should replay.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. The journal records a recoverable update first
  2. A committed transaction must be distinguishable from a partial one

The journal records a recoverable update first

Creating a directory entry can change a directory block, an inode and allocation metadata. Updating them independently can leave an inconsistent combination after a crash. A journaling filesystem can write an update description or new block image to the journal, persist the required records, then persist a commit marker. Only after the journal can recover the transaction may the main structures be updated under that protocol.

A committed transaction must be distinguishable from a partial one

Recovery validates transaction structure and replays committed records using their ordering. A partially written transaction whose commit contract fails should not have an effect. Metadata-only and full-data journaling make different promises about file payloads. Crash consistency covers durability ordering across application operations. Write-ahead logging applies a related architecture to database transactions.[1]

References

  1. Remzi H. Arpaci-Dusseau and Andrea C. Arpaci-Dusseau, Operating Systems: Three Easy Pieces ↩