From 4dc38e9e3d7ed74ffae3917b3ba9e8901559ae78 Mon Sep 17 00:00:00 2001 From: Onur Tirtir Date: Fri, 21 Jan 2022 17:37:59 +0300 Subject: [PATCH] Use EnsureCompatibleLocalExecutionState instead (#5640) --- src/backend/distributed/executor/adaptive_executor.c | 7 +------ .../distributed/executor/repartition_join_execution.c | 3 +-- src/include/distributed/repartition_join_execution.h | 1 + 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/backend/distributed/executor/adaptive_executor.c b/src/backend/distributed/executor/adaptive_executor.c index ae4db9b49..6161b7d70 100644 --- a/src/backend/distributed/executor/adaptive_executor.c +++ b/src/backend/distributed/executor/adaptive_executor.c @@ -1028,12 +1028,7 @@ ExecuteTaskListExtended(ExecutionParams *executionParams) * then we should error out as it would cause inconsistencies across the * remote connection and local execution. */ - List *remoteTaskList = execution->remoteTaskList; - if (GetCurrentLocalExecutionStatus() == LOCAL_EXECUTION_REQUIRED && - AnyTaskAccessesLocalNode(remoteTaskList)) - { - ErrorIfTransactionAccessedPlacementsLocally(); - } + EnsureCompatibleLocalExecutionState(execution->remoteTaskList); /* run the remote execution */ StartDistributedExecution(execution); diff --git a/src/backend/distributed/executor/repartition_join_execution.c b/src/backend/distributed/executor/repartition_join_execution.c index ae55b14b3..dfe8efd9e 100644 --- a/src/backend/distributed/executor/repartition_join_execution.c +++ b/src/backend/distributed/executor/repartition_join_execution.c @@ -50,7 +50,6 @@ static void TraverseJobTree(Job *curJob, List **jobs); static char * GenerateCreateSchemasCommand(List *jobIds, char *schemaOwner); static char * GenerateJobCommands(List *jobIds, char *templateCommand); 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 * any visibility problems because of local execution. */ -static void +void EnsureCompatibleLocalExecutionState(List *taskList) { /* diff --git a/src/include/distributed/repartition_join_execution.h b/src/include/distributed/repartition_join_execution.h index 784d0d9cf..596dffc0b 100644 --- a/src/include/distributed/repartition_join_execution.h +++ b/src/include/distributed/repartition_join_execution.h @@ -13,6 +13,7 @@ #include "nodes/pg_list.h" extern List * ExecuteDependentTasks(List *taskList, Job *topLevelJob); +extern void EnsureCompatibleLocalExecutionState(List *taskList); extern void DoRepartitionCleanup(List *jobIds);