How savepoints quietly throttled our Postgres queue
Case study 15 min +150 XP
Using a SAVEPOINT per tick in a Postgres-backed job queue made every locked row carry a MultiXact ID in xmax.
Using a SAVEPOINT per tick in a Postgres-backed job queue made every locked row carry a MultiXact ID in xmax.
Postgres deadlocks come from transactions acquiring locks in inconsistent orders, and the main fix is to restructure transactions so they always lock resources in the same sequence.