Parallel GIN, BRIN builds fail to maintain ii_BrokenHotChain

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Tomas Vondra <tomas(at)vondra(dot)me>
Subject: Parallel GIN, BRIN builds fail to maintain ii_BrokenHotChain
Date: 2026-11-20 00:46:01
Message-ID: CAH2-Wz=UKBJ-f2oZpG8XJTnGbivmjM2nuyhw+5P3xBzeWmhSWw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

My LLM produced the attached patch, which adds an isolation test
showing that parallel index builds of both GIN and BRIN indexes fail
to maintain ii_BrokenHotChain correctly. The test fails, demonstrating
incorrect results.

The underlying bug is straightforward: both GIN and BRIN lack the
required handling. If any individual parallel worker sets
ii_BrokenHotChain, then it has to be passed on to the leader so that
pg_index.indcheckxmin gets set correctly. Otherwise, older snapshots
can use the index even though it isn't guaranteed to have index tuples
for every row version that the snapshot can still see. nbtree gets
this right, but that precedent seems to have been missed.

--
Peter Geoghegan

Attachment Content-Type Size
v1-0001-Add-isolation-test-for-index-builds-over-broken-H.patch application/octet-stream 7.1 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2026-11-20 00:47:26 Re: Hash aggregate collisions cause excessive spilling
Previous Message Michael Paquier 2026-11-20 00:41:40 Re: Injection point: fix race condition between attach and cleanup