pgsql: Fix query ID reporting in parallel workers for GIN index builds

From: Tomas Vondra <tomas(dot)vondra(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix query ID reporting in parallel workers for GIN index builds
Date: 2026-11-26 13:18:55
Message-ID: E1xWZNH-00000000OsW-0MhX@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix query ID reporting in parallel workers for GIN index builds

Commit 6fd5071909a made parallel workers for VACUUM, BRIN and btree
index builds report the query ID of the leader, so that they show up
with the correct query_id in pg_stat_activity. Parallel GIN index
builds were added later by 8492feb98f6, but did not include this,
so GIN build workers have always reported a query ID of 0.

Fix by storing the leader's query ID in the shared build state and
reporting it in the worker, like the other index AMs already do.

No backpatch, for the same reason as 6fd5071909a. This is arguably a
bug, but a minor one and nobody has complained about it.

Author: Lukas Fittl <lukas(at)fittl(dot)com>
Discussion: https://postgr.es/m/CAP53Pkw3WcVbg61G29AmN=6XkuxGryoWKnhTyC1JmkT08i8qVA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/91993c160de4c6973f79541db9bfeb441c6eef31

Modified Files
--------------
src/backend/access/gin/gininsert.c | 7 +++++++
1 file changed, 7 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2026-11-26 13:21:46 pgsql: Prevent stack overflow in exprLocation()
Previous Message Daniel Gustafsson 2026-11-26 12:40:08 pgsql: Remove backwards compatibility ifdef for SSL_AD_NO_APPLICATION_P