Merge pull request #2664 from citusdata/fix-ActivePlacementList

Don't schedule tasks on inactive nodes.
pull/2690/head
Hadi Moshayedi 2019-04-26 10:11:58 -07:00 committed by GitHub
commit 4cb8ed0f9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -5213,6 +5213,12 @@ ActiveShardPlacementLists(List *taskList)
/* filter out shard placements that reside in inactive nodes */
List *activeShardPlacementList = ActivePlacementList(shardPlacementList);
if (activeShardPlacementList == NIL)
{
ereport(ERROR,
(errmsg("no active placements were found for shard " UINT64_FORMAT,
anchorShardId)));
}
/* sort shard placements by their creation time */
activeShardPlacementList = SortList(activeShardPlacementList,
@ -5271,7 +5277,7 @@ ActivePlacementList(List *placementList)
/* check if the worker node for this shard placement is active */
workerNode = FindWorkerNode(placement->nodeName, placement->nodePort);
if (workerNode != NULL)
if (workerNode != NULL && workerNode->isActive)
{
activePlacementList = lappend(activePlacementList, placement);
}