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
v1-0001-Add-isolation-test-for-index-builds-over-broken-H.patch
Description: Binary data
