The setting maxlockspertransaction is mysterious, it is a good illustration of Socrates' "I know that I know nothing". This is the main fact to memorize about maxlockspertransaction. Don't try to remember details. Unless you touch it often, you'll forget (I do). Instead, let's rely on the docs:|
In 2023-2024, after incidents that multiple customers of PostgresAI experienced, when production nodes were down because of LWLock:LockManager contention, we studied it in synthetic environments.|
After 2-003, @ninjouz asked on X:|
As we discussed, Lock Manager manages heavyweight locks – various kinds of them (various modes, various levels of granularity). These locks are released only at the end of the transaction.|
Let's talk about relation-level locks and various confusions, surprises and what is worth to remember in practice.|
To warm up, let's talk about lightweight and heavyweight locks (or "regular locks" or just "locks").| PostgresAI