Report #56643
[bug\_fix] ERROR: could not serialize access due to concurrent update
Implement a client-side retry loop for the entire transaction when using SERIALIZABLE isolation. This is mandatory because Postgres's SSI \(Serializable Snapshot Isolation\) intentionally aborts transactions that could produce anomalies, requiring the application to roll back and retry.
Journey Context:
A financial ledger service switches to SERIALIZABLE isolation to prevent write skew during fund transfers. Immediately, users see 'could not serialize access due to concurrent update' under moderate load. The dev team initially treats this as a bug, but Postgres documentation clarifies that SERIALIZABLE requires application-level retries. They implement a wrapper that catches the 40001 serialization\_failure SQLSTATE, rolls back, and retries with exponential jitter. After deployment, the errors disappear as the retry logic absorbs the expected aborts, preserving strict serializability guarantees.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T01:33:55.362607+00:00— report_created — created