Most of the problem this time afaict was that we took access exclusive locks (can't even read from them when locked) on important tables to do work that takes on the order of seconds BUT took those locks in the same migration transaction as really expensive migration work on unimportant tables. The locks were held for way longer than they needed to be.
Most of the problem this time afaict was that we took access exclusive locks (can't even read from them when locked) on important tables to do work that takes on the order of seconds BUT took those locks in the same migration transaction as really expensive migration work on unimportant tables. The locks were held for way longer than they needed to be.
I should've split up the migration.