aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorNoah Misch <noah@leadboat.com>2024-06-27 19:21:05 -0700
committerNoah Misch <noah@leadboat.com>2024-06-27 19:21:05 -0700
commitbb93640a681c2cc709e9836e169c8f3eb556df57 (patch)
treebdd9c37008aa9d200cfbfd264ee3b24794f5aa1a /doc/src
parent0844b3968985447ed0a6937cfc8639e379da2fe6 (diff)
downloadpostgresql-bb93640a681c2cc709e9836e169c8f3eb556df57.tar.gz
postgresql-bb93640a681c2cc709e9836e169c8f3eb556df57.zip
Add wait event type "InjectionPoint", a custom type like "Extension".
Both injection points and customization of type "Extension" are new in v17, so this just changes a detail of an unreleased feature. Reported by Robert Haas. Reviewed by Michael Paquier. Discussion: https://postgr.es/m/CA+TgmobfMU5pdXP36D5iAwxV5WKE_vuDLtp_1QyH+H5jMMt21g@mail.gmail.com
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/monitoring.sgml12
-rw-r--r--doc/src/sgml/xfunc.sgml4
2 files changed, 14 insertions, 2 deletions
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index b2ad9b446f3..991f6299075 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -1064,6 +1064,14 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</entry>
</row>
<row>
+ <entry><literal>InjectionPoint</literal></entry>
+ <entry>The server process is waiting for an injection point to reach an
+ outcome defined in a test. See
+ <xref linkend="xfunc-addin-injection-points"/> for more details. This
+ type has no predefined wait points.
+ </entry>
+ </row>
+ <row>
<entry><literal>IO</literal></entry>
<entry>The server process is waiting for an I/O operation to complete.
<literal>wait_event</literal> will identify the specific wait point;
@@ -1139,8 +1147,8 @@ description | Waiting for a newly initialized WAL file to reach durable storage
<note>
<para>
- Extensions can add <literal>Extension</literal> and
- <literal>LWLock</literal> events
+ Extensions can add <literal>Extension</literal>,
+ <literal>InjectionPoint</literal>. and <literal>LWLock</literal> events
to the lists shown in <xref linkend="wait-event-extension-table"/> and
<xref linkend="wait-event-lwlock-table"/>. In some cases, the name
of an <literal>LWLock</literal> assigned by an extension will not be
diff --git a/doc/src/sgml/xfunc.sgml b/doc/src/sgml/xfunc.sgml
index 1d0b65193e3..f3a3e4e2f8f 100644
--- a/doc/src/sgml/xfunc.sgml
+++ b/doc/src/sgml/xfunc.sgml
@@ -3643,7 +3643,11 @@ extern void InjectionPointAttach(const char *name,
static void
custom_injection_callback(const char *name, const void *private_data)
{
+ uint32 wait_event_info = WaitEventInjectionPointNew(name);
+
+ pgstat_report_wait_start(wait_event_info);
elog(NOTICE, "%s: executed custom callback", name);
+ pgstat_report_wait_end();
}
</programlisting>
This callback prints a message to server error log with severity