mirror of https://github.com/citusdata/citus.git
Use ResourceOwner to track WaitEventSet in PG17
Relevant PG commit:
50c67c2019ab9ade8aa8768bfe604cd802fe8591
50c67c2019
pull/7699/head
parent
8513145ae5
commit
7ac47941bd
|
@ -866,7 +866,8 @@ WaitEventSetFromMultiConnectionStates(List *connections, int *waitCount)
|
|||
*waitCount = 0;
|
||||
}
|
||||
|
||||
WaitEventSet *waitEventSet = CreateWaitEventSet(CurrentMemoryContext, eventSetSize);
|
||||
WaitEventSet *waitEventSet = CreateWaitEventSet(WaitEventSetTracker_compat,
|
||||
eventSetSize);
|
||||
EnsureReleaseResource((MemoryContextCallbackFunction) (&FreeWaitEventSet),
|
||||
waitEventSet);
|
||||
|
||||
|
|
|
@ -1130,7 +1130,7 @@ BuildWaitEventSet(MultiConnection **allConnections, int totalConnectionCount,
|
|||
|
||||
/* allocate pending connections + 2 for the signal latch and postmaster death */
|
||||
/* (CreateWaitEventSet makes room for pgwin32_signal_event automatically) */
|
||||
WaitEventSet *waitEventSet = CreateWaitEventSet(CurrentMemoryContext,
|
||||
WaitEventSet *waitEventSet = CreateWaitEventSet(WaitEventSetTracker_compat,
|
||||
pendingConnectionCount + 2);
|
||||
|
||||
for (int connectionIndex = 0; connectionIndex < pendingConnectionCount;
|
||||
|
|
|
@ -4740,7 +4740,7 @@ BuildWaitEventSet(List *sessionList)
|
|||
int eventSetSize = GetEventSetSize(sessionList);
|
||||
|
||||
WaitEventSet *waitEventSet =
|
||||
CreateWaitEventSet(CurrentMemoryContext, eventSetSize);
|
||||
CreateWaitEventSet(WaitEventSetTracker_compat, eventSetSize);
|
||||
|
||||
WorkerSession *session = NULL;
|
||||
foreach_declared_ptr(session, sessionList)
|
||||
|
|
|
@ -98,6 +98,8 @@ getStxstattarget_compat(HeapTuple tup)
|
|||
#define getAlterStatsStxstattarget_compat(a) ((Node *) makeInteger(a))
|
||||
#define getIntStxstattarget_compat(a) (intVal(a))
|
||||
|
||||
#define WaitEventSetTracker_compat CurrentResourceOwner
|
||||
|
||||
#else
|
||||
|
||||
#include "access/htup_details.h"
|
||||
|
@ -119,6 +121,8 @@ getStxstattarget_compat(HeapTuple tup)
|
|||
#define getAlterStatsStxstattarget_compat(a) (a)
|
||||
#define getIntStxstattarget_compat(a) (a)
|
||||
|
||||
#define WaitEventSetTracker_compat CurrentMemoryContext
|
||||
|
||||
#endif
|
||||
|
||||
#if PG_VERSION_NUM >= PG_VERSION_16
|
||||
|
|
Loading…
Reference in New Issue