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

Commit110eb4a

Browse files
committed
Remove enum WaitEventExtension
This enum was used to determine the first ID to use when assigning acustom wait event for extensions, which is always 1. It was kept soas it would be possible to add new in-core wait events in the category"Extension". There is no such thing currently, so let's remove thisenum until a case justifying it pops up. This makes the code simplerand easier to understand.This has as effect to switch back autoprewarm.c to use PG_WAIT_EXTENSIONrather than WAIT_EVENT_EXTENSION, on par with v16 and older stablebranches.Thinko inc9af054.Reported-by: Peter EisentrautDiscussion:https://postgr.es/m/195c6c45-abce-4331-be6a-e87724e1d060@eisentraut.org
1 parent372700c commit110eb4a

File tree

4 files changed

+5
-13
lines changed

4 files changed

+5
-13
lines changed

‎contrib/pg_prewarm/autoprewarm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ autoprewarm_main(Datum main_arg)
226226
(void)WaitLatch(MyLatch,
227227
WL_LATCH_SET |WL_EXIT_ON_PM_DEATH,
228228
-1L,
229-
WAIT_EVENT_EXTENSION);
229+
PG_WAIT_EXTENSION);
230230
}
231231
else
232232
{
@@ -253,7 +253,7 @@ autoprewarm_main(Datum main_arg)
253253
(void)WaitLatch(MyLatch,
254254
WL_LATCH_SET |WL_TIMEOUT |WL_EXIT_ON_PM_DEATH,
255255
delay_in_ms,
256-
WAIT_EVENT_EXTENSION);
256+
PG_WAIT_EXTENSION);
257257
}
258258

259259
/* Reset the latch, loop. */

‎src/backend/utils/activity/wait_event.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ typedef struct WaitEventExtensionCounterData
8989
staticWaitEventExtensionCounterData*WaitEventExtensionCounter;
9090

9191
/* first event ID of custom wait events for extensions */
92-
#defineNUM_BUILTIN_WAIT_EVENT_EXTENSION\
93-
(WAIT_EVENT_EXTENSION_FIRST_USER_DEFINED - WAIT_EVENT_EXTENSION)
92+
#defineWAIT_EVENT_EXTENSION_INITIAL_ID1
9493

9594
/* wait event info for extensions */
9695
#defineWAIT_EVENT_EXTENSION_INFO(eventId)(PG_WAIT_EXTENSION | eventId)
@@ -129,7 +128,7 @@ WaitEventExtensionShmemInit(void)
129128
if (!found)
130129
{
131130
/* initialize the allocation counter and its spinlock. */
132-
WaitEventExtensionCounter->nextId=NUM_BUILTIN_WAIT_EVENT_EXTENSION;
131+
WaitEventExtensionCounter->nextId=WAIT_EVENT_EXTENSION_INITIAL_ID;
133132
SpinLockInit(&WaitEventExtensionCounter->mutex);
134133
}
135134

@@ -244,7 +243,7 @@ GetWaitEventExtensionIdentifier(uint16 eventId)
244243
WaitEventExtensionEntryById*entry;
245244

246245
/* Built-in event? */
247-
if (eventId<NUM_BUILTIN_WAIT_EVENT_EXTENSION)
246+
if (eventId<WAIT_EVENT_EXTENSION_INITIAL_ID)
248247
return"Extension";
249248

250249
/* It is a user-defined wait event, so lookup hash table. */

‎src/include/utils/wait_event.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,6 @@ extern PGDLLIMPORT uint32 *my_wait_event_info;
5353
*
5454
* The ID retrieved can be used with pgstat_report_wait_start() or equivalent.
5555
*/
56-
typedefenum
57-
{
58-
WAIT_EVENT_EXTENSION=PG_WAIT_EXTENSION,
59-
WAIT_EVENT_EXTENSION_FIRST_USER_DEFINED,
60-
}WaitEventExtension;
61-
6256
externvoidWaitEventExtensionShmemInit(void);
6357
externSizeWaitEventExtensionShmemSize(void);
6458

‎src/tools/pgindent/typedefs.list

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3100,7 +3100,6 @@ WaitEvent
31003100
WaitEventActivity
31013101
WaitEventBufferPin
31023102
WaitEventClient
3103-
WaitEventExtension
31043103
WaitEventExtensionCounterData
31053104
WaitEventExtensionEntryById
31063105
WaitEventExtensionEntryByName

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp