Re: [BUG?] check_exclusion_or_unique_constraint false negative

Поиск
Список
Период
Сортировка
Искать
От
Michail Nikolaev
Тема
Re: [BUG?] check_exclusion_or_unique_constraint false negative
Дата
Msg-id
CANtu0ohU2XRV9shtu14CffLPDS1x10q7ebOGf-vX0p+45_L8jw@mail.gmail.com
Ответ на
Список
Дерево обсуждения
[BUG?] check_exclusion_or_unique_constraint false negative Michail Nikolaev <michail.nikolaev@gmail.com>
Re: [BUG?] check_exclusion_or_unique_constraint false negative Michail Nikolaev <michail.nikolaev@gmail.com>
Re: [BUG?] check_exclusion_or_unique_constraint false negative Michail Nikolaev <michail.nikolaev@gmail.com>
Re: [BUG?] check_exclusion_or_unique_constraint false negative Michail Nikolaev <michail.nikolaev@gmail.com>
RE: [BUG?] check_exclusion_or_unique_constraint false negative "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
Re: [BUG?] check_exclusion_or_unique_constraint false negative Michail Nikolaev <michail.nikolaev@gmail.com>
Re: [BUG?] check_exclusion_or_unique_constraint false negative Amit Kapila <amit.kapila16@gmail.com>
Re: [BUG?] check_exclusion_or_unique_constraint false negative Michail Nikolaev <michail.nikolaev@gmail.com>
Re: [BUG?] check_exclusion_or_unique_constraint false negative Amit Kapila <amit.kapila16@gmail.com>
Re: [BUG?] check_exclusion_or_unique_constraint false negative Michail Nikolaev <michail.nikolaev@gmail.com>
RE: [BUG?] check_exclusion_or_unique_constraint false negative "Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>
Re: [BUG?] check_exclusion_or_unique_constraint false negative Michail Nikolaev <michail.nikolaev@gmail.com>
RE: [BUG?] check_exclusion_or_unique_constraint false negative "Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>
Re: [BUG?] check_exclusion_or_unique_constraint false negative Michail Nikolaev <michail.nikolaev@gmail.com>
Re: [BUG?] check_exclusion_or_unique_constraint false negative Michail Nikolaev <michail.nikolaev@gmail.com>
Hello, Andres.

Sorry to bother you, but I feel it's necessary to validate the possible issue regarding someone who can decide whether it is okay or not.
The issue is reproducible with the first UPSERT implementation (your commit 168d5805e4c08bed7b95d351bf097cff7c07dd65 from 2015) and up to now.

The problem appears as follows:
* A unique index contains a specific value (in the test, it is the only value for the entire index).
* check_exclusion_or_unique_constraint returns FALSE for that value in some random cases.
* Technically, this means index_getnext finds 0 records, even though we know the value exists in the index.

I was able to reproduce this only with an UNLOGGED table.
I can't find any scenarios that are actually broken (since the issue is resolved by speculative insertion later), but this looks suspicious to me. It could be a symptom of some tricky race condition in the btree.

Best regards,
Mikhail
В списке pgsql-hackers по дате отправления
От: Pavel Stehule
Дата:
От: Andrew Dunstan
Дата:
FAQ