Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbb93640

Browse files
committed
Add wait event type "InjectionPoint", a custom type like "Extension".
Both injection points and customization of type "Extension" are new inv17, 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
1 parent0844b39 commitbb93640

File tree

13 files changed

+215
-131
lines changed

13 files changed

+215
-131
lines changed

‎doc/src/sgml/monitoring.sgml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,6 +1063,14 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
10631063
See <xref linkend="wait-event-extension-table"/>.
10641064
</entry>
10651065
</row>
1066+
<row>
1067+
<entry><literal>InjectionPoint</literal></entry>
1068+
<entry>The server process is waiting for an injection point to reach an
1069+
outcome defined in a test. See
1070+
<xref linkend="xfunc-addin-injection-points"/> for more details. This
1071+
type has no predefined wait points.
1072+
</entry>
1073+
</row>
10661074
<row>
10671075
<entry><literal>IO</literal></entry>
10681076
<entry>The server process is waiting for an I/O operation to complete.
@@ -1139,8 +1147,8 @@ description | Waiting for a newly initialized WAL file to reach durable storage
11391147

11401148
<note>
11411149
<para>
1142-
Extensions can add <literal>Extension</literal> and
1143-
<literal>LWLock</literal> events
1150+
Extensions can add <literal>Extension</literal>,
1151+
<literal>InjectionPoint</literal>. and <literal>LWLock</literal> events
11441152
to the lists shown in <xref linkend="wait-event-extension-table"/> and
11451153
<xref linkend="wait-event-lwlock-table"/>. In some cases, the name
11461154
of an <literal>LWLock</literal> assigned by an extension will not be

‎doc/src/sgml/xfunc.sgml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3643,7 +3643,11 @@ extern void InjectionPointAttach(const char *name,
36433643
static void
36443644
custom_injection_callback(const char *name, const void *private_data)
36453645
{
3646+
uint32 wait_event_info = WaitEventInjectionPointNew(name);
3647+
3648+
pgstat_report_wait_start(wait_event_info);
36463649
elog(NOTICE, "%s: executed custom callback", name);
3650+
pgstat_report_wait_end();
36473651
}
36483652
</programlisting>
36493653
This callback prints a message to server error log with severity

‎src/backend/storage/ipc/ipci.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ CalculateShmemSize(int *num_semaphores)
149149
size=add_size(size,SyncScanShmemSize());
150150
size=add_size(size,AsyncShmemSize());
151151
size=add_size(size,StatsShmemSize());
152-
size=add_size(size,WaitEventExtensionShmemSize());
152+
size=add_size(size,WaitEventCustomShmemSize());
153153
size=add_size(size,InjectionPointShmemSize());
154154
size=add_size(size,SlotSyncShmemSize());
155155
#ifdefEXEC_BACKEND
@@ -355,7 +355,7 @@ CreateOrAttachShmemStructs(void)
355355
SyncScanShmemInit();
356356
AsyncShmemInit();
357357
StatsShmemInit();
358-
WaitEventExtensionShmemInit();
358+
WaitEventCustomShmemInit();
359359
InjectionPointShmemInit();
360360
}
361361

‎src/backend/utils/activity/generate-wait_event_types.pl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,10 @@
181181
foreachmy$waitclass (sort {uc($a)cmpuc($b) }keys%hashwe)
182182
{
183183
# Don't generate the pgstat_wait_event.c and wait_event_types.h files
184-
# forExtension, LWLock and Lock, these are handled independently.
184+
# fortypes handled independently.
185185
next
186186
if ($waitclasseq'WaitEventExtension'
187+
||$waitclasseq'WaitEventInjectionPoint'
187188
||$waitclasseq'WaitEventLWLock'
188189
||$waitclasseq'WaitEventLock');
189190

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp