mirror of https://github.com/citusdata/citus.git
Handle LWLockRegisterTranche changes
The initialization of a custom lock tranche is somewhat simplified in PostgreSQL 10: now a name and identifier are sufficient.pull/1439/head
parent
0b4b9aa5a9
commit
3c507e7399
|
@ -578,6 +578,13 @@ TaskTrackerShmemInit(void)
|
|||
|
||||
if (!alreadyInitialized)
|
||||
{
|
||||
#if (PG_VERSION_NUM >= 100000)
|
||||
WorkerTasksSharedState->taskHashTrancheId = LWLockNewTrancheId();
|
||||
WorkerTasksSharedState->taskHashTrancheName = "Worker Task Hash Tranche";
|
||||
LWLockRegisterTranche(WorkerTasksSharedState->taskHashTrancheId,
|
||||
WorkerTasksSharedState->taskHashTrancheName);
|
||||
#else
|
||||
|
||||
/* initialize lwlock protecting the task tracker hash table */
|
||||
LWLockTranche *tranche = &WorkerTasksSharedState->taskHashLockTranche;
|
||||
|
||||
|
@ -586,6 +593,8 @@ TaskTrackerShmemInit(void)
|
|||
tranche->array_stride = sizeof(LWLock);
|
||||
tranche->name = "Worker Task Hash Tranche";
|
||||
LWLockRegisterTranche(WorkerTasksSharedState->taskHashTrancheId, tranche);
|
||||
#endif
|
||||
|
||||
LWLockInitialize(&WorkerTasksSharedState->taskHashLock,
|
||||
WorkerTasksSharedState->taskHashTrancheId);
|
||||
}
|
||||
|
|
|
@ -99,7 +99,11 @@ typedef struct WorkerTasksSharedStateData
|
|||
|
||||
/* Lock protecting workerNodesHash */
|
||||
int taskHashTrancheId;
|
||||
#if (PG_VERSION_NUM >= 100000)
|
||||
char *taskHashTrancheName;
|
||||
#else
|
||||
LWLockTranche taskHashLockTranche;
|
||||
#endif
|
||||
LWLock taskHashLock;
|
||||
} WorkerTasksSharedStateData;
|
||||
|
||||
|
|
Loading…
Reference in New Issue