Fast seralizable transactions starving slower ones

Поиск
Список
Период
Сортировка
От Viktor Fougstedt
Тема Fast seralizable transactions starving slower ones
Дата
Msg-id 84A17190-EC3D-43BC-BCA6-7E288023AAC9@chalmers.se
обсуждение исходный текст
Список pgsql-general
Hello!

We have a system with a lot of integrity constraints that are not easily expressed as SQL constraints. We therefore run
allwriting transactions in serializable isolation, so that our code can make SELECT:s to check the constraints.
 

We’ve run in to a, well, it’s not a “problem”, because everything is working according to spec. But some of our
transactionsare much quicker than the other. Since the first COMMIT of colliding seralizable transactions always wins,
theshorter transactions starve the slower ones, which are always restarted.
 

We’re now working on a solution where all transactions start by taking an advisory lock. Normally transactions release
itimmediately, but a transaction which has been restarted multiple times will keep it, preventing any others from
starting.Thereby it will run to completion, normally within a maximum of one more restart.
 

Are there any other solutions to this starvation problem? 

Regards,
/Viktor

В списке pgsql-general по дате отправления:

Предыдущее
От: Jan Claeys
Дата:
Сообщение: Re: Code of Conduct plan
Следующее
От: Chris Travers
Дата:
Сообщение: Re: Code of Conduct plan