diff --git a/src/backend/distributed/executor/adaptive_executor.c b/src/backend/distributed/executor/adaptive_executor.c index 0ad2a246d..8192b51e5 100644 --- a/src/backend/distributed/executor/adaptive_executor.c +++ b/src/backend/distributed/executor/adaptive_executor.c @@ -3491,6 +3491,15 @@ PlacementExecutionDone(TaskPlacementExecution *placementExecution, bool succeede TaskExecutionState executionState = shardCommandExecution->executionState; bool failedPlacementExecutionIsOnPendingQueue = false; + if (placementExecution->executionState == PLACEMENT_EXECUTION_FAILED) + { + /* + * We may mark placements as failed multiple times, but should only act + * the first time. Nor should we accept success after failure. + */ + return; + } + /* mark the placement execution as finished */ if (succeeded) {