mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-28 00:41:52 +02:00
Remove enum WaitEventExtension
This enum was used to determine the first ID to use when assigning a
custom wait event for extensions, which is always 1. It was kept so
as 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 this
enum until a case justifying it pops up. This makes the code simpler
and easier to understand.
This has as effect to switch back autoprewarm.c to use PG_WAIT_EXTENSION
rather than WAIT_EVENT_EXTENSION, on par with v16 and older stable
branches.
Thinko in c9af054653
.
Reported-by: Peter Eisentraut
Discussion: https://postgr.es/m/195c6c45-abce-4331-be6a-e87724e1d060@eisentraut.org
This commit is contained in:
parent
372700cf30
commit
110eb4aefb
@ -226,7 +226,7 @@ autoprewarm_main(Datum main_arg)
|
|||||||
(void) WaitLatch(MyLatch,
|
(void) WaitLatch(MyLatch,
|
||||||
WL_LATCH_SET | WL_EXIT_ON_PM_DEATH,
|
WL_LATCH_SET | WL_EXIT_ON_PM_DEATH,
|
||||||
-1L,
|
-1L,
|
||||||
WAIT_EVENT_EXTENSION);
|
PG_WAIT_EXTENSION);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -253,7 +253,7 @@ autoprewarm_main(Datum main_arg)
|
|||||||
(void) WaitLatch(MyLatch,
|
(void) WaitLatch(MyLatch,
|
||||||
WL_LATCH_SET | WL_TIMEOUT | WL_EXIT_ON_PM_DEATH,
|
WL_LATCH_SET | WL_TIMEOUT | WL_EXIT_ON_PM_DEATH,
|
||||||
delay_in_ms,
|
delay_in_ms,
|
||||||
WAIT_EVENT_EXTENSION);
|
PG_WAIT_EXTENSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Reset the latch, loop. */
|
/* Reset the latch, loop. */
|
||||||
|
@ -89,8 +89,7 @@ typedef struct WaitEventExtensionCounterData
|
|||||||
static WaitEventExtensionCounterData *WaitEventExtensionCounter;
|
static WaitEventExtensionCounterData *WaitEventExtensionCounter;
|
||||||
|
|
||||||
/* first event ID of custom wait events for extensions */
|
/* first event ID of custom wait events for extensions */
|
||||||
#define NUM_BUILTIN_WAIT_EVENT_EXTENSION \
|
#define WAIT_EVENT_EXTENSION_INITIAL_ID 1
|
||||||
(WAIT_EVENT_EXTENSION_FIRST_USER_DEFINED - WAIT_EVENT_EXTENSION)
|
|
||||||
|
|
||||||
/* wait event info for extensions */
|
/* wait event info for extensions */
|
||||||
#define WAIT_EVENT_EXTENSION_INFO(eventId) (PG_WAIT_EXTENSION | eventId)
|
#define WAIT_EVENT_EXTENSION_INFO(eventId) (PG_WAIT_EXTENSION | eventId)
|
||||||
@ -129,7 +128,7 @@ WaitEventExtensionShmemInit(void)
|
|||||||
if (!found)
|
if (!found)
|
||||||
{
|
{
|
||||||
/* initialize the allocation counter and its spinlock. */
|
/* initialize the allocation counter and its spinlock. */
|
||||||
WaitEventExtensionCounter->nextId = NUM_BUILTIN_WAIT_EVENT_EXTENSION;
|
WaitEventExtensionCounter->nextId = WAIT_EVENT_EXTENSION_INITIAL_ID;
|
||||||
SpinLockInit(&WaitEventExtensionCounter->mutex);
|
SpinLockInit(&WaitEventExtensionCounter->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -244,7 +243,7 @@ GetWaitEventExtensionIdentifier(uint16 eventId)
|
|||||||
WaitEventExtensionEntryById *entry;
|
WaitEventExtensionEntryById *entry;
|
||||||
|
|
||||||
/* Built-in event? */
|
/* Built-in event? */
|
||||||
if (eventId < NUM_BUILTIN_WAIT_EVENT_EXTENSION)
|
if (eventId < WAIT_EVENT_EXTENSION_INITIAL_ID)
|
||||||
return "Extension";
|
return "Extension";
|
||||||
|
|
||||||
/* It is a user-defined wait event, so lookup hash table. */
|
/* It is a user-defined wait event, so lookup hash table. */
|
||||||
|
@ -53,12 +53,6 @@ extern PGDLLIMPORT uint32 *my_wait_event_info;
|
|||||||
*
|
*
|
||||||
* The ID retrieved can be used with pgstat_report_wait_start() or equivalent.
|
* The ID retrieved can be used with pgstat_report_wait_start() or equivalent.
|
||||||
*/
|
*/
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
WAIT_EVENT_EXTENSION = PG_WAIT_EXTENSION,
|
|
||||||
WAIT_EVENT_EXTENSION_FIRST_USER_DEFINED,
|
|
||||||
} WaitEventExtension;
|
|
||||||
|
|
||||||
extern void WaitEventExtensionShmemInit(void);
|
extern void WaitEventExtensionShmemInit(void);
|
||||||
extern Size WaitEventExtensionShmemSize(void);
|
extern Size WaitEventExtensionShmemSize(void);
|
||||||
|
|
||||||
|
@ -3100,7 +3100,6 @@ WaitEvent
|
|||||||
WaitEventActivity
|
WaitEventActivity
|
||||||
WaitEventBufferPin
|
WaitEventBufferPin
|
||||||
WaitEventClient
|
WaitEventClient
|
||||||
WaitEventExtension
|
|
||||||
WaitEventExtensionCounterData
|
WaitEventExtensionCounterData
|
||||||
WaitEventExtensionEntryById
|
WaitEventExtensionEntryById
|
||||||
WaitEventExtensionEntryByName
|
WaitEventExtensionEntryByName
|
||||||
|
Loading…
Reference in New Issue
Block a user