Use EnsureCompatibleLocalExecutionState instead (#5640)

pull/5630/head
Onur Tirtir 2022-01-21 17:37:59 +03:00 committed by GitHub
parent a2b05f0d28
commit 4dc38e9e3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 8 deletions

View File

@ -1028,12 +1028,7 @@ ExecuteTaskListExtended(ExecutionParams *executionParams)
* then we should error out as it would cause inconsistencies across the * then we should error out as it would cause inconsistencies across the
* remote connection and local execution. * remote connection and local execution.
*/ */
List *remoteTaskList = execution->remoteTaskList; EnsureCompatibleLocalExecutionState(execution->remoteTaskList);
if (GetCurrentLocalExecutionStatus() == LOCAL_EXECUTION_REQUIRED &&
AnyTaskAccessesLocalNode(remoteTaskList))
{
ErrorIfTransactionAccessedPlacementsLocally();
}
/* run the remote execution */ /* run the remote execution */
StartDistributedExecution(execution); StartDistributedExecution(execution);

View File

@ -50,7 +50,6 @@ static void TraverseJobTree(Job *curJob, List **jobs);
static char * GenerateCreateSchemasCommand(List *jobIds, char *schemaOwner); static char * GenerateCreateSchemasCommand(List *jobIds, char *schemaOwner);
static char * GenerateJobCommands(List *jobIds, char *templateCommand); static char * GenerateJobCommands(List *jobIds, char *templateCommand);
static char * GenerateDeleteJobsCommand(List *jobIds); static char * GenerateDeleteJobsCommand(List *jobIds);
static void EnsureCompatibleLocalExecutionState(List *taskList);
/* /*
@ -79,7 +78,7 @@ ExecuteDependentTasks(List *topLevelTasks, Job *topLevelJob)
* EnsureCompatibleLocalExecutionState makes sure that the tasks won't have * EnsureCompatibleLocalExecutionState makes sure that the tasks won't have
* any visibility problems because of local execution. * any visibility problems because of local execution.
*/ */
static void void
EnsureCompatibleLocalExecutionState(List *taskList) EnsureCompatibleLocalExecutionState(List *taskList)
{ {
/* /*

View File

@ -13,6 +13,7 @@
#include "nodes/pg_list.h" #include "nodes/pg_list.h"
extern List * ExecuteDependentTasks(List *taskList, Job *topLevelJob); extern List * ExecuteDependentTasks(List *taskList, Job *topLevelJob);
extern void EnsureCompatibleLocalExecutionState(List *taskList);
extern void DoRepartitionCleanup(List *jobIds); extern void DoRepartitionCleanup(List *jobIds);