~/talk

How to corrupt your database (and how to deal with data corruption)

Talkat PostgreSQL Conference Europe 2023 · 2023-12-12..12-15· [databases]
links:none on file
slides:none on file

Turning off fsync=off yields a measured 2.5x speedup but an OS crash can “toast” the cluster; enabling synchronous_commit instead gives safer performance tradeoffs. File-system backups without the backup_label or using pg_upgrade --link can start two servers on the same files and silently corrupt data. Emergency tools like pg_resetwal -f or pg_surgery can make the server start but usually introduce more corruption. Recommended recovery path is stop, save disk images, dump and restore from verified logical and physical backups (use tools like pgBackRest).

AI-written summary · about

  1. 0:00Introduction to data corruption
  2. 1:09What is database corruption
  3. 2:33Bad hardware and software causes
  4. 3:38Disabling fsync for performance
  5. 4:20File system backup mistakes
  6. 7:56Using pg_resetwal dangerously
  7. 9:44Corrupting with pg_upgrade
  8. 11:49Modifying catalogs directly
  9. 13:57First steps after corruption
  10. 14:59Backup strategies for recovery
  11. 16:49Index corruption explained
  12. 18:34Silent data corruption cases
  13. 20:20Corrupted blocks and checksums
  14. 21:49Handling toast corruption
  15. 25:21Crashes during queries
  16. 27:53Missing or empty files
  17. 29:39Key takeaways and prevention
  18. 30:46Q&A session
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.