Re: query_id, pg_stat_activity, extended query protocol

From: Alexander Lakhin <exclusion(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Sami Imseih <samimseih(at)gmail(dot)com>, jian he <jian(dot)universality(at)gmail(dot)com>, Anthonin Bonnefoy <anthonin(dot)bonnefoy(at)datadoghq(dot)com>, Andrei Lepikhov <lepihov(at)gmail(dot)com>, kaido vaikla <kaido(dot)vaikla(at)gmail(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: query_id, pg_stat_activity, extended query protocol
Date: 2024-10-03 19:00:00
Message-ID: b37d8e6c-e83d-e157-8865-1b2460a6aef2@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello Michael,

02.10.2024 06:29, Michael Paquier wrote:
> On Wed, Oct 02, 2024 at 06:00:00AM +0300, Alexander Lakhin wrote:
>> Fortunately, it's still pretty warm here, so I'm wearing T-shirt and my
>> sleeve isn't long enough for that, but if you gave me 2-3 days, I would
>> focus on researching this area...
> Sure, thanks. I am also spending a few days thinking about patterns
> around that before doing anything. The buildfarm is green, so there
> is some flebxibility.

I've managed to falsify the Assert in ExecutorRun() with the following:
SET compute_query_id = 'off';
SET track_activities = 'off';

CREATE PROCEDURE p1()
LANGUAGE plpgsql
AS $$
BEGIN
    PERFORM 1;
END;
$$;

CREATE PROCEDURE p2(x int)
LANGUAGE plpgsql
AS $$
BEGIN
  IF x = 1 THEN
    SET track_activities = 'on';
    SET compute_query_id = 'on';
  END IF;
  CALL p1();
END;
$$;

CALL p2(0);

CALL p2(1);

TRAP: failed Assert("!IsQueryIdEnabled() || !pgstat_track_activities || !debug_query_string || pgstat_get_my_query_id()
!= 0"), File: "execMain.c", Line: 312, PID: 3765791

Best regards,
Alexander

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2024-10-03 19:19:45 Re: pg_basebackup and error messages dependent on the order of the arguments
Previous Message Robert Haas 2024-10-03 18:35:24 Re: allowing extensions to control planner behavior