mirror of
https://github.com/postgres/postgres.git
synced 2025-07-21 16:02:15 +03:00
Provide DSM segment to ExecXXXInitializeWorker functions.
Previously, executor nodes running in parallel worker processes didn't have access to the dsm_segment object used for parallel execution. In order to support resource management based on DSM segment lifetime, they need that. So create a ParallelWorkerContext object to hold it and pass it to all InitializeWorker functions. Author: Thomas Munro Reviewed-By: Andres Freund Discussion: https://postgr.es/m/CAEepm=2W=cOkiZxcg6qiFQP-dHUe09aqTrEMM7yJDrHMhDv_RA@mail.gmail.com
This commit is contained in:
@ -210,7 +210,8 @@ ExecCustomScanReInitializeDSM(CustomScanState *node, ParallelContext *pcxt)
|
||||
}
|
||||
|
||||
void
|
||||
ExecCustomScanInitializeWorker(CustomScanState *node, shm_toc *toc)
|
||||
ExecCustomScanInitializeWorker(CustomScanState *node,
|
||||
ParallelWorkerContext *pwcxt)
|
||||
{
|
||||
const CustomExecMethods *methods = node->methods;
|
||||
|
||||
@ -219,8 +220,8 @@ ExecCustomScanInitializeWorker(CustomScanState *node, shm_toc *toc)
|
||||
int plan_node_id = node->ss.ps.plan->plan_node_id;
|
||||
void *coordinate;
|
||||
|
||||
coordinate = shm_toc_lookup(toc, plan_node_id, false);
|
||||
methods->InitializeWorkerCustomScan(node, toc, coordinate);
|
||||
coordinate = shm_toc_lookup(pwcxt->toc, plan_node_id, false);
|
||||
methods->InitializeWorkerCustomScan(node, pwcxt->toc, coordinate);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user