Module 6 · Logging and recovery

Episode 42 Checkpoints and ARIES

10 min · SQL · Postgres

Title card of Episode 42: Checkpoints and ARIES

▶ This video is coming to YouTube soon.

What does a database do in the second after a crash? This episode takes a fuzzy checkpoint, crashes the system, and plays ARIES's analysis, redo and undo passes record by record, including a second crash in the middle of undo. Then it kills a real Postgres and proves its recovery is redo only: the uncommitted row version is still on the page, invisible.

Chapters

  1. 0:00Intro
  2. 0:15kill -9, then a fraction of a second
  3. 0:41Fuzzy checkpoints: nobody waits
  4. 2:03ARIES in three ideas
  5. 2:25Pass 1, analysis: rebuild the tables
  6. 3:13Pass 2, redo: repeat history
  7. 4:12Pass 3, undo: newest first, with CLRs
  8. 4:56A crash during undo
  9. 5:46The code: redo's test and the undo loop
  10. 6:21Postgres: redo, and no undo at all
  11. 7:15Proof: a Postgres checkpoint
  12. 7:38Proof: one commit, one not, then kill -9
  13. 8:08Proof: Postgres's recovery is redo only
  14. 8:51ARIES vs. Postgres
  15. 9:27Recap
  16. 9:52Next: Lab: Pull the Plug