~/talk

PostgreSQL Replication Conflicts: Avoiding Pitfalls

Talkat Percona Live 2022 · 2022-05-16..05-18· [databases]
slides:none on file

Shows how PostgreSQL counts and reacts to standby-only replication failures with concrete internals: the pg_stat_database_conflicts view has five counters and increments on explicit backend termination; conflicts occur only on standbys and commonly are lock and snapshot related; a reproduction on Postgres 14.1 (CentOS 7) demonstrates dropping a table or vacuuming while a long transaction holds a relation—default max_standby_streaming_delay 30s triggers termination; using hot_standby_feedback and inspecting pg_stat_replication/pg_stat_wal_receiver informs mitigation.

AI-written summary · about

  1. 0:00Start
  2. 3:23Replication Issues - Overview Reliable replication scheme requires
  3. 4:47Presentation Outline
  4. 5:52Types of Locks in PostgreSQL
  5. 17:10Synching Up • Synchronous Streaming Replication
  6. 18:49Relevant Replication Catalogs and Views
  7. 20:47Replication Data: PostgreSQL Out of the Box • The only view to expose conflict statistics: Standby pg_stat_database_conflicts
  8. 21:52Replication Configuration • Configuration Parameters Sending Server
  9. 25:55What Conflicts?
  10. 27:04Replication Issues?
  11. 27:41Types of Replication Issues Faced
  12. 28:58Types of Conflict
  13. 32:34Replication: Lock Conflict
  14. 34:09Lock Conflict - Code Flow
  15. 44:34Snapshot Conflicts - Code Flow • Start XLog Processing
~/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.