pg_dump fails intermittently with 'could not serialize access' during high-concurrency writes on PostgreSQL 13
Environment
PostgreSQL 13 on Debian 11, primary database handling OLTP writes during business hours with several highly concurrent UPDATE/INSERT workloads from application servers. Backups performed with pg_dump (logical) using multiple parallel jobs at 02:00 daily.
Symptoms
pg_dump process terminates with 'ERROR: could not serialize access due to concurrent update' for one or more transactions, causing the nightly logical backup to fail intermittently only during the busiest import windows. Retrying the dump sometimes succeeds outside the peak load window.
Observations
pg_dump is invoked without --serializable-deferrable in previous runs but pg_dump may use a snapshot transaction for consistency; database logs show many concurrent transactions locking rows in hot tables. No unusual resource exhaustion (CPU, memory, I/O) observed; long-running UPDATEs are present during the attempted dump.
Already attempted
Shifted the pg_dump start time to lower-traffic periods (helpful but not always possible), tried a retry loop wrapper for failed pg_dump jobs, and attempted to run the dump on the primary while briefly pausing a heavy importer — impractical for production windows.
Question
Why is pg_dump failing with serialization errors under heavy concurrent writes, and what are safe, less disruptive strategies to obtain consistent logical backups without impacting production write throughput?
Verified community troubleshooting
No answers yet..
Incident analysis
Most likely causes
Summary
Suggested Fixes
Continue troubleshooting
Related troubles
Matched from the title, description and tags
- Databases26% match
Logical backups hang waiting for locks when VACUUM FULL is running on large PostgreSQL tables
Open0 answers - Databases24% match
PostgreSQL logical replication slot grows until disk full after subscriber disconnects during nightly load
Open0 answers - Databases23% match
PostgreSQL standby stops applying WAL during long-running transactions on primary after pg_basebackup restore
Open0 answers - Databases21% match
PostgreSQL logical replication falls behind after ALTER TABLE ADD COLUMN with non-null DEFAULT on large table
Open0 answers - Databases21% match
PostgreSQL 14: lo_export/large object operations intermittently fail with 'could not open large object' when keepalives drop during long client transactions
Open0 answers