From 7f1e621734da69fe0f17bee29c6b7ed9a9924781 Mon Sep 17 00:00:00 2001 From: Jelte Fennema Date: Tue, 7 Jul 2020 17:28:30 +0200 Subject: [PATCH] Revert "Fix divide by zero error" This reverts commit b197a603f0c71d43e45ff518ea85c7f211bb1b8a. --- src/backend/distributed/planner/multi_physical_planner.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/distributed/planner/multi_physical_planner.c b/src/backend/distributed/planner/multi_physical_planner.c index df8c4ec9b..955fca0b0 100644 --- a/src/backend/distributed/planner/multi_physical_planner.c +++ b/src/backend/distributed/planner/multi_physical_planner.c @@ -2107,7 +2107,7 @@ BuildMapMergeJob(Query *jobQuery, List *dependentJobList, Var *partitionKey, static uint32 HashPartitionCount(void) { - uint32 groupCount = list_length(ActiveReadableNodeList()); + uint32 groupCount = ActiveReadableWorkerNodeCount(); double maxReduceTasksPerNode = MaxRunningTasksPerNode / 2.0; uint32 partitionCount = (uint32) rint(groupCount * maxReduceTasksPerNode); @@ -5717,7 +5717,7 @@ AssignDualHashTaskList(List *taskList) * if subsequent jobs have a small number of tasks, we won't allocate the * tasks to the same worker repeatedly. */ - List *workerNodeList = ActiveReadableNodeList(); + List *workerNodeList = ActiveReadableWorkerNodeList(); uint32 workerNodeCount = (uint32) list_length(workerNodeList); uint32 beginningNodeIndex = jobId % workerNodeCount;