From 4989c9a15cd90b8a464149aff08bb44602efa626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Tue, 14 Jan 2020 00:18:24 +0000 Subject: [PATCH] PlacementExecutionDone: We may mark placements as failed multiple times, but should only act the first time. --- src/backend/distributed/executor/adaptive_executor.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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) {