aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeCustom.c
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2017-11-16 17:28:11 -0800
committerAndres Freund <andres@anarazel.de>2017-11-16 17:39:18 -0800
commit7082e614c0dd504cdf49c4d5a692159f22e78f9d (patch)
tree21aab7cbd15866af06b423cd90c6b97520b248bc /src/backend/executor/nodeCustom.c
parent09a777447a858a01ac4d547d678ba295d9542c3b (diff)
downloadpostgresql-7082e614c0dd504cdf49c4d5a692159f22e78f9d.tar.gz
postgresql-7082e614c0dd504cdf49c4d5a692159f22e78f9d.zip
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
Diffstat (limited to 'src/backend/executor/nodeCustom.c')
-rw-r--r--src/backend/executor/nodeCustom.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/backend/executor/nodeCustom.c b/src/backend/executor/nodeCustom.c
index 07dcabef551..5f1732d6ac0 100644
--- a/src/backend/executor/nodeCustom.c
+++ b/src/backend/executor/nodeCustom.c
@@ -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);
}
}