pgsql: Expand assertion check for query ID reporting in executor - Mailing list pgsql-committers

From Michael Paquier
Subject pgsql: Expand assertion check for query ID reporting in executor
Date
Msg-id E1svQGG-001dxP-LV@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Expand assertion check for query ID reporting in executor

As formulated, the assertion added in the executor by 24f520594809 to
check that a query ID is set had two problems:
- track_activities may be disabled while compute_query_id is enabled,
causing the query ID to not be reported to pg_stat_activity.
- debug_query_string may not be set in some context.  The only path
where this would matter is visibly autovacuum, should parallel workers
be enabled there at some point.  This is not the case currently.

There was no test showing the interactions between the query ID and
track_activities, so let's add one based on a scan of pg_stat_activity.
This assertion is still an experimentation at this stage, but let's see
if this shows more paths where query IDs are not properly set while they
should.

Discussion: https://postgr.es/m/Zvn5616oYXmpXyHI@paquier.xyz

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5deb56387e3a1d08e1e62bed031258db267a0ab5

Modified Files
--------------
src/backend/executor/execMain.c   | 18 +++++++++++++++---
src/test/regress/expected/guc.out | 21 +++++++++++++++++++++
src/test/regress/sql/guc.sql      | 12 ++++++++++++
3 files changed, 48 insertions(+), 3 deletions(-)


pgsql-committers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: pgsql: Add missing command for pg_maintain in comment
Next
From: Tatsuo Ishii
Date:
Subject: pgsql: Doc: replace unnecessary non-breaking space with ordinal space.