Re: [BUG?] check_exclusion_or_unique_constraint false negative

From: Michail Nikolaev <michail(dot)nikolaev(at)gmail(dot)com>
To: "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: [BUG?] check_exclusion_or_unique_constraint false negative
Date: 2024-08-12 11:11:26
Message-ID: CANtu0oiziTBM8+WDtkktMZv0rhGBroYGWwqSQW+MzOWpmk-XEw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello, Hou zj!

> In my test, if the tuple is updated and new tuple is in the same page,
> heapam_index_fetch_tuple should find the new tuple using HOT chain. So,
it's a
> bit unclear to me how the updated tuple is missing. Maybe I missed some
other
> conditions for this issue.

Yeah, I think the pgbench-based reproducer may also cause page splits in
btree.
But we may add an index to the table to disable HOT.

I have attached a reproducer for this case using a spec and injection
points.

I hope it helps, check the attached files.

Best regards,
Mikhail.

Attachment Content-Type Size
v2-0002-additional-test-spec-to-reproduce-dirty-snapshot-.patch text/x-patch 5.8 KB
v2-0001-fix-for-lost-record-in-case-of-DirtySnapshot-inde.patch text/x-patch 16.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Aleksander Alekseev 2024-08-12 11:32:42 Re: format_datum debugging function
Previous Message Ilia Evdokimov 2024-08-12 10:59:24 Re: Add support for (Var op Var) clause in extended MCV statistics