public inbox for [email protected]
help / color / mirror / Atom feedRe: [BUG?] check_exclusion_or_unique_constraint false negative
2+ messages / 1 participants
[nested] [flat]
* Re: [BUG?] check_exclusion_or_unique_constraint false negative
@ 2024-07-21 15:27 Michail Nikolaev <[email protected]>
0 siblings, 1 reply; 2+ messages in thread
From: Michail Nikolaev @ 2024-07-21 15:27 UTC (permalink / raw)
To: pgsql-hackers; Andres Freund <[email protected]>
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
>
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [BUG?] check_exclusion_or_unique_constraint false negative
@ 2024-07-24 20:01 Michail Nikolaev <[email protected]>
parent: Michail Nikolaev <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: Michail Nikolaev @ 2024-07-24 20:01 UTC (permalink / raw)
To: pgsql-hackers; Andres Freund <[email protected]>
Hello, everyone!
Updates so far:
* issue happens with both LOGGED and UNLOGGED relations
* issue happens with DirtySnapshot
* not happens with SnapshotSelf
* not happens with SnapshotAny
* not related to speculative inserted tuples - I have commented the code of
its insertion - and the issue continues to occur.
Best regards,
Mikhail.
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2024-07-24 20:01 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-07-21 15:27 Re: [BUG?] check_exclusion_or_unique_constraint false negative Michail Nikolaev <[email protected]>
2024-07-24 20:01 ` Michail Nikolaev <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox