diff --git a/src/backend/distributed/executor/adaptive_executor.c b/src/backend/distributed/executor/adaptive_executor.c index 49e37596c..64310c836 100644 --- a/src/backend/distributed/executor/adaptive_executor.c +++ b/src/backend/distributed/executor/adaptive_executor.c @@ -938,33 +938,14 @@ DistributedExecutionRequiresRollback(DistributedExecution *execution) return true; } - /* - * Checking the first task's placement list is not sufficient for all purposes since - * for append/range distributed tables we might have unequal number of placements for - * shards. However, it is safe to do here, because we're searching for a reference - * table. All other cases return false for this purpose. - */ - task = (Task *) linitial(taskList); if (list_length(task->taskPlacementList) > 1) { /* - * Some tasks don't set replicationModel thus we only - * rely on the anchorShardId, not replicationModel. - * - * TODO: Do we ever need replicationModel in the Task structure? - * Can't we always rely on anchorShardId? + * Adaptive executor opts to error out on queries if a placement is unhealthy, + * not marking the placement itself unhealthy in the process. + * Use 2PC to rollback placements before the unhealthy shard failed. */ - uint64 anchorShardId = task->anchorShardId; - if (anchorShardId != INVALID_SHARD_ID && ReferenceTableShardId(anchorShardId)) - { - return true; - } - - /* - * Single DML/DDL tasks with replicated tables (non-reference) - * should not require BEGIN/COMMIT/ROLLBACK. - */ - return false; + return true; } return false;