fix-4212
Teja Mupparti 2025-06-06 17:43:47 -07:00
parent fb33900669
commit 1a20c4fe6d
6 changed files with 13 additions and 1 deletions

View File

@ -897,6 +897,7 @@ AdaptiveExecutor(CitusScanState *scanState)
FinishDistributedExecution(execution); FinishDistributedExecution(execution);
job->jobExecuted = true;
if (SortReturning && distributedPlan->expectResults && commandType != CMD_SELECT) if (SortReturning && distributedPlan->expectResults && commandType != CMD_SELECT)
{ {
SortTupleStore(scanState); SortTupleStore(scanState);

View File

@ -41,12 +41,17 @@ ExecuteSubPlans(DistributedPlan *distributedPlan)
uint64 planId = distributedPlan->planId; uint64 planId = distributedPlan->planId;
List *subPlanList = distributedPlan->subPlanList; List *subPlanList = distributedPlan->subPlanList;
if (distributedPlan->workerJob)
distributedPlan->workerJob->jobExecuted = true;
distributedPlan->subPlansExecuted = true;
if (subPlanList == NIL) if (subPlanList == NIL)
{ {
/* no subplans to execute */ /* no subplans to execute */
return; return;
} }
HTAB *intermediateResultsHash = MakeIntermediateResultHTAB(); HTAB *intermediateResultsHash = MakeIntermediateResultHTAB();
RecordSubplanExecutionsOnNodes(intermediateResultsHash, distributedPlan); RecordSubplanExecutionsOnNodes(intermediateResultsHash, distributedPlan);

View File

@ -1395,6 +1395,7 @@ FinalizePlan(PlannedStmt *localPlan, DistributedPlan *distributedPlan)
PlannedStmt *finalPlan = NULL; PlannedStmt *finalPlan = NULL;
CustomScan *customScan = makeNode(CustomScan); CustomScan *customScan = makeNode(CustomScan);
MultiExecutorType executorType = MULTI_EXECUTOR_INVALID_FIRST; MultiExecutorType executorType = MULTI_EXECUTOR_INVALID_FIRST;
distributedPlan->subPlansExecuted = false;
/* this field is used in JobExecutorType */ /* this field is used in JobExecutorType */
distributedPlan->relationIdList = localPlan->relationOids; distributedPlan->relationIdList = localPlan->relationOids;

View File

@ -625,7 +625,7 @@ ExplainJob(CitusScanState *scanState, Job *job, ExplainState *es,
ExplainOpenGroup("Job", "Job", true, es); ExplainOpenGroup("Job", "Job", true, es);
ExplainPropertyInteger("Task Count", NULL, taskCount, es); ExplainPropertyInteger("Task Count", NULL, taskCount, es);
if (ShowReceivedTupleData(scanState, es)) if (ShowReceivedTupleData(scanState, es) || job->jobExecuted)
{ {
Task *task = NULL; Task *task = NULL;
uint64 totalReceivedTupleDataForAllTasks = 0; uint64 totalReceivedTupleDataForAllTasks = 0;

View File

@ -1692,6 +1692,7 @@ CreateJob(Query *query)
job->subqueryPushdown = false; job->subqueryPushdown = false;
job->requiresCoordinatorEvaluation = false; job->requiresCoordinatorEvaluation = false;
job->deferredPruning = false; job->deferredPruning = false;
job->jobExecuted = false;
return job; return job;
} }
@ -1791,6 +1792,7 @@ CreateTask(TaskType taskType)
task->modifyWithSubquery = false; task->modifyWithSubquery = false;
task->partiallyLocalOrRemote = false; task->partiallyLocalOrRemote = false;
task->relationShardList = NIL; task->relationShardList = NIL;
task->taskCompleted = false;
return task; return task;
} }

View File

@ -153,6 +153,7 @@ typedef struct Job
*/ */
bool parametersInJobQueryResolved; bool parametersInJobQueryResolved;
uint32 colocationId; /* common colocation group ID of the relations */ uint32 colocationId; /* common colocation group ID of the relations */
bool jobExecuted;
} Job; } Job;
@ -334,6 +335,7 @@ typedef struct Task
Const *partitionKeyValue; Const *partitionKeyValue;
int colocationId; int colocationId;
bool taskCompleted;
} Task; } Task;
@ -471,6 +473,7 @@ typedef struct DistributedPlan
* of source rows to be repartitioned for colocation with the target. * of source rows to be repartitioned for colocation with the target.
*/ */
int sourceResultRepartitionColumnIndex; int sourceResultRepartitionColumnIndex;
bool subPlansExecuted;
} DistributedPlan; } DistributedPlan;