RE: Add pg_get_injection_points() for information of injection points - Mailing list pgsql-hackers

From Hayato Kuroda (Fujitsu)
Subject RE: Add pg_get_injection_points() for information of injection points
Date
Msg-id OSCPR01MB149664969EE88A9F2E3FC9F8AF5B32@OSCPR01MB14966.jpnprd01.prod.outlook.com
Whole thread Raw
In response to Add pg_get_injection_points() for information of injection points  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Add pg_get_injection_points() for information of injection points
List pgsql-hackers
Dear Michael,

Thanks for creating the patch! Let me confirm two points:

Apart from functions related with injection_points, this can be called even when
postgres has been built with -Dinjection_points=false. This is intentional because
this function does not have any side-effect and just refers the status. Is my
understanding correct?

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?


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.

[1]:
```
SELECT injection_points_attach('TestInjectionLog', 'notice');
 injection_points_attach
-------------------------

(1 row)

SELECT injection_points_attach('TestInjectionError', 'error');
 injection_points_attach
-------------------------

(1 row)

SELECT injection_points_detach('TestInjectionLog');
 injection_points_detach
-------------------------

(1 row)

SELECT name, library, function FROM pg_get_injection_points()
  ORDER BY name COLLATE "C";
server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
connection to server was lost
```

Best regards,
Hayato Kuroda
FUJITSU LIMITED


Attachment

pgsql-hackers by date:

Previous
From: Daniil Davydov
Date:
Subject: Re: Accessing an invalid pointer in BufferManagerRelation structure
Next
From: Tender Wang
Date:
Subject: Re: MergeJoin beats HashJoin in the case of multiple hash clauses