Re: Unexpected serialization error

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: Unexpected serialization error
Дата
Msg-id
1661461.1613236918@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
Unexpected serialization error Luka Žitnik <luka.zitnik@gmail.com>
Re: Unexpected serialization error Tom Lane <tgl@sss.pgh.pa.us>
Re: Unexpected serialization error Luka Žitnik <luka.zitnik@gmail.com>
=?UTF-8?B?THVrYSDFvWl0bmlr?=  writes:
> I had no luck over at general slack channel. So I'm beginning to treat this
> as a bug. Here's a test case that unexpectedly fails at last insert. I
> expect it not to fail because the rows that the two transactions act on are
> unrelated to one another.

The bug is that you're assuming exact tracking of the SSI serialization
rules. It's not done that way, because it'd be prohibitively expensive.
(I've not dug into this example in any detail, but I suspect it's
acquiring page-level not tuple-level predicate locks, thus the
transactions conflict because each tries to update a page the other one
already read.)

The short answer is that ANY application that's depending on serializable
mode MUST be prepared to retry serialization failures.  You don't get to
skip that just because there theoretically shouldn't be a failure.

			regards, tom lane


В списке pgsql-bugs по дате отправления
От: Sven Klemm
Дата:
От: Viktor Semykin
Дата:
Сообщение: An issue with missing rows
FAQ