RE: Add pg_get_injection_points() for information of injection points

From: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
To: 'Michael Paquier' <michael(at)paquier(dot)xyz>
Cc: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: RE: Add pg_get_injection_points() for information of injection points
Date: 2025-04-15 02:49:24
Message-ID: OSCPR01MB14966594457B49A6822866480F5B22@OSCPR01MB14966.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dear Michael,

> Yes. The function could be changed to return an ERROR if the build
> does not support this option. It's more portable to return NULL if
> you have some queries that do joins. This could be used with
> pg_stat_activity and wait events for example, and some points are in
> positions strategic enough that they could be used across more than
> one library, like the restart point one or the autovacuum startup one.

Thanks for the description. +1.

> > I'm not sure it is directly related, but ISTM there are no direct ways to check
> > whether the injection_points is enabled or not. How do you think adding the
> > function?
>
> Yeah, we could use something like that, not sure if that's worth it.

We can fork new thread when it is required...

> > Regarding the internal of the patch, it could be crashed when two points are
> > attached and then first one is detached [1]. I think we should not use "idx" for
> > the result array - PSA the fix.
>
> Oops. That's a brain fart from my side. Thanks.

Confirmed v2 could fix the issue. One minor comment related with my part:

Should cur_pos be uint32 instead of int? Either of them can work because
cur_pos can be [0, 128], but it may be clearer.

Apart from above, LGTM.

Best regards,
Hayato Kuroda
FUJITSU LIMITED

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-04-15 02:58:28 Recent pg_rewind test failures in buildfarm
Previous Message jian he 2025-04-15 00:37:53 Re: bug in stored generated column over domain with constraints.