
Transaction (ACID Properties): atomic operation (resilient to power failure)
Atomicity: all or nothing (commit, abort/rollback)
Consistency: no break invariants
Isolation: concurrent transactions do not interfere with each other
Durability: once we declare committed, it must exist
Rollback Siturations:
conflict: two transactions try to update the same file, we can only commit one of them, the other must be rolled back
explicit software rollback: condition check failed
system crash: roll back to last stable state
Write Ahead Log (WAL): sequential log of intended changes, [task1, task2, ..., commit, task3, task4, ..., commit, ...]
before doing any write, write the intended change to a contiguous log (append-only)
make sure log can be applied multiple times (idempotent, no "increment" operation, only "set to value")
write backs (resume) can be applied asynchronously
Journaling: only apply WAL to metadata (most OS). Logging: apply WLA to metadata and data. (ext4 support both, but default to journaling)
Table of Content