Module 6 · Logging and recovery
Episode 43 Lab: Pull the Plug
▶ This video is coming to YouTube soon.
A hands-on crash lab. We kill -9 Postgres in the middle of thousands of bank transfers and count what survives, measure recovery time and WAL replayed, then turn synchronous_commit off: much faster commits, and a crash right after COMMIT really does lose the newest ones, without corrupting anything. Plus why fsync = off is never the answer.
Chapters
- 0:00Intro
- 0:14The symptom: commits are slow
- 0:35Reproduce: kill -9 in the middle of the transfers
- 1:12Measure: what survived, and how fast
- 1:46Diagnose: COMMIT waits for the disk
- 2:23Diagnose: why half a transfer never shows
- 2:58What decides recovery time
- 3:29The fix: synchronous_commit = off
- 4:02Diagnose: the risk window
- 4:37Measure: crash right after COMMIT, three times
- 5:26Two honest caveats, and one setting to never touch
- 5:59Before / after
- 6:29Recap
- 6:55Next: Season Finale