Catch a high transaction rollback rate
xact_rollback against xact_commit is a one-line health check nobody runs. Here 200 of 506 transactions rolled back, 39.5%, and every single one was the same duplicate key.
Problem
What you're actually looking at
The symptom as it shows up on a real server.
Applications swallow errors. A retry loop that fails four times out of ten still looks fine from the outside, while the database burns transaction IDs, WAL and connection time on work that is thrown away. pg_stat_database counts it for you at no cost.
An importer feeding tracking_barcodes re-sends barcodes it has already loaded. Nothing alerts, because from the application's point of view the import 'completes'.
Simple terms
Applications quietly swallow errors, so a retry loop failing four times out of ten can look perfectly healthy from the outside while the database wastes transaction IDs, WAL, and connection time on work it throws away. Comparing rolled-back transactions against committed ones is a one-line health check almost nobody runs, and a high rollback rate usually points straight at one repeating error, like the same duplicate key over and over.
Full runbook for this incident
- The full identify checklist, the exact signals that tell you it's this incident
- Every diagnostic query; lab output is attached only to the steps we actually captured
- The resolution path and the pitfalls that make it worse
- Mitigation steps to stop it recurring, plus a verify-you're-done query
Card required. Cancel before day 7 and you are not charged.
More in this category
Other Observability runbooks
Neighbouring incidents that share the same diagnostic surface.
Connected
How this connects to the rest of the library
A live view of this page's real cross-references, what explains it, what fixes it, what to tune, and where to go next. Every link is an authored relationship, not a guess.
Need the full procedure?
Pro runbooks finish the incident path
Free runbooks teach the shape. Pro opens the full step transcript, edge cases, and prevention depth.