pcxt->seg);
}
- /*
- * Make the area available to executor nodes running in the leader. See
- * also ParallelQueryMain which makes it available to workers.
- */
- estate->es_query_dsa = pei->area;
-
/*
* Give parallel-aware nodes a chance to initialize their shared data.
* This also initializes the elements of instrumentation->ps_instrument,
d.pcxt = pcxt;
d.instrumentation = instrumentation;
d.nnodes = 0;
+
+ /* Install our DSA area while initializing the plan. */
+ estate->es_query_dsa = pei->area;
ExecParallelInitializeDSM(planstate, &d);
+ estate->es_query_dsa = NULL;
/*
* Make sure that the world hasn't shifted under our feet. This could
ExecParallelReinitialize(PlanState *planstate,
ParallelExecutorInfo *pei)
{
+ EState *estate = planstate->state;
+
/* Old workers must already be shut down */
Assert(pei->finished);
pei->finished = false;
/* Traverse plan tree and let each child node reset associated state. */
+ estate->es_query_dsa = pei->area;
ExecParallelReInitializeDSM(planstate, pei->pcxt);
+ estate->es_query_dsa = NULL;
}
/*
if (gatherstate->need_to_scan_locally)
{
+ EState *estate = gatherstate->ps.state;
+
+ /* Install our DSA area while executing the plan. */
+ estate->es_query_dsa =
+ gatherstate->pei ? gatherstate->pei->area : NULL;
outerTupleSlot = ExecProcNode(outerPlan);
+ estate->es_query_dsa = NULL;
if (!TupIsNull(outerTupleSlot))
return outerTupleSlot;
{
PlanState *outerPlan = outerPlanState(gm_state);
TupleTableSlot *outerTupleSlot;
+ EState *estate = gm_state->ps.state;
+ /* Install our DSA area while executing the plan. */
+ estate->es_query_dsa = gm_state->pei ? gm_state->pei->area : NULL;
outerTupleSlot = ExecProcNode(outerPlan);
+ estate->es_query_dsa = NULL;
if (!TupIsNull(outerTupleSlot))
{