Re: serializable anomaly - duplicate primary keys

From: Aleksander Alekseev <aleksander(at)tigerdata(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>, Bryan Green <dbryan(dot)green(at)gmail(dot)com>, Jacob Brazeal <jacob(dot)brazeal(at)gmail(dot)com>
Subject: Re: serializable anomaly - duplicate primary keys
Date: 2026-10-12 14:49:58
Message-ID: CAJ7c6TPuaFHoi9V4FByPybT-EoD0kq5eeyWmmachRh57-erRRg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

> Actually I think we should do just the opposite - focus on the patch
> that can be backported and discuss possible improvements for the
> `master` branch later.

> I prepared a PoC patch that shows how this could be archived. Also it
> includes regression tests for everything discussed above.
>
> One drawback I discovered is that the patch introduces a
> false-positive conflict detection that causes the existing
> partition-key-update-3.spec to fail. I'm not 100% certain what to do
> about it. Given the fact that SSI generally has false-positives, maybe
> we should just rewrite the test? This seems to be better compared to
> what we currently have and personally I don't have better proposals at
> the moment.

I think I found a fix that doesn't break ABI or the existing
behaviour. It introduces a per-backend global variable which is not
pretty, but it works and we can always refactor the code in the
`master` branch after backpatching.

Please see PoC v2. Any feedback is most welcome.

--
Best regards,
Aleksander Alekseev

Attachment Content-Type Size
v2-0001-PoC-bugfix-by-a.alekseev-v2.patch text/x-patch 17.4 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Previous Message Amit Kapila 2026-10-12 14:28:55 Re: Fix WITHOUT OVERLAPS multirange with location replication