From f7c2af04111a209894a7c45723a83790f937ff71 Mon Sep 17 00:00:00 2001 From: SaitTalhaNisanci Date: Wed, 26 Aug 2020 13:12:10 +0300 Subject: [PATCH] Rename RemoveCoordinatorPlacement (#4125) RemoveCoordinatorPlacement does not do what it says. It removes the coordinator placement only if there are other placements, so it is not a single node, and only if the coordinator has a placement. --- .../distributed/planner/multi_router_planner.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/backend/distributed/planner/multi_router_planner.c b/src/backend/distributed/planner/multi_router_planner.c index 136ac8337..42f69cc89 100644 --- a/src/backend/distributed/planner/multi_router_planner.c +++ b/src/backend/distributed/planner/multi_router_planner.c @@ -164,7 +164,7 @@ static List * SingleShardTaskList(Query *query, uint64 jobId, List *relationShardList, List *placementList, uint64 shardId, bool parametersInQueryResolved); static bool RowLocksOnRelations(Node *node, List **rtiLockList); -static List * RemoveCoordinatorPlacement(List *placementList); +static List * RemoveCoordinatorPlacementIfNotSingleNode(List *placementList); static void ReorderTaskPlacementsByTaskAssignmentPolicy(Job *job, TaskAssignmentPolicyType taskAssignmentPolicy, @@ -1814,7 +1814,7 @@ ReorderTaskPlacementsByTaskAssignmentPolicy(Job *job, * connect to the worker nodes. */ Assert(ReadOnlyTask(task->taskType)); - placementList = RemoveCoordinatorPlacement(placementList); + placementList = RemoveCoordinatorPlacementIfNotSingleNode(placementList); /* reorder the placement list */ List *reorderedPlacementList = RoundRobinReorder(placementList); @@ -1830,14 +1830,14 @@ ReorderTaskPlacementsByTaskAssignmentPolicy(Job *job, /* - * RemoveCoordinatorPlacement gets a task placement list and returns the list + * RemoveCoordinatorPlacementIfNotSingleNode gets a task placement list and returns the list * by removing the placement belonging to the coordinator (if any). * - * If the list has a single entry or no placements on the coordinator, the list - * is return unmodified. + * If the list has a single element or no placements on the coordinator, the list + * returned is unmodified. */ static List * -RemoveCoordinatorPlacement(List *placementList) +RemoveCoordinatorPlacementIfNotSingleNode(List *placementList) { ListCell *placementCell = NULL;