mirror of https://github.com/citusdata/citus.git
return early in ExecuteTaskListExtended (#3738)
It is possible to return an error in ExecuteTaskListExtended after performing local execution with the current structure. However there is no point in execution the local tasks if we are going to return an error later. So the local execution is moved after the error check.pull/3737/head
parent
117233c1e0
commit
362d72853c
|
@ -961,11 +961,8 @@ ExecuteTaskListExtended(RowModifyLevel modLevel, List *taskList,
|
|||
if (localExecutionSupported && ShouldExecuteTasksLocally(taskList))
|
||||
{
|
||||
bool readOnlyPlan = false;
|
||||
|
||||
/* set local (if any) & remote tasks */
|
||||
ExtractLocalAndRemoteTasks(readOnlyPlan, taskList, &localTaskList,
|
||||
&remoteTaskList);
|
||||
locallyProcessedRows += ExecuteLocalTaskList(localTaskList, tupleStore);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -983,6 +980,8 @@ ExecuteTaskListExtended(RowModifyLevel modLevel, List *taskList,
|
|||
ErrorIfTransactionAccessedPlacementsLocally();
|
||||
}
|
||||
|
||||
locallyProcessedRows += ExecuteLocalTaskList(localTaskList, tupleStore);
|
||||
|
||||
if (MultiShardConnectionType == SEQUENTIAL_CONNECTION)
|
||||
{
|
||||
targetPoolSize = 1;
|
||||
|
|
|
@ -136,6 +136,10 @@ static void LocallyExecuteUdfTaskQuery(Query *localUdfCommandQuery);
|
|||
uint64
|
||||
ExecuteLocalTaskList(List *taskList, Tuplestorestate *tupleStoreState)
|
||||
{
|
||||
if (list_length(taskList) == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
DistributedPlan *distributedPlan = NULL;
|
||||
ParamListInfo paramListInfo = NULL;
|
||||
return ExecuteLocalTaskListExtended(taskList, paramListInfo, distributedPlan,
|
||||
|
|
Loading…
Reference in New Issue