Prevent empty placement creation in the coordinator

pull/4409/head
naisila 2020-12-11 22:35:45 +03:00
parent 00bd784783
commit 5234caecca
1 changed files with 8 additions and 0 deletions

View File

@ -411,6 +411,14 @@ CreateAppendDistributedShardPlacements(Oid relationId, int64 shardId,
{ {
int workerNodeIndex = attemptNumber % workerNodeCount; int workerNodeIndex = attemptNumber % workerNodeCount;
WorkerNode *workerNode = (WorkerNode *) list_nth(workerNodeList, workerNodeIndex); WorkerNode *workerNode = (WorkerNode *) list_nth(workerNodeList, workerNodeIndex);
if (NodeIsCoordinator(workerNode))
{
ereport(NOTICE, (errmsg(
"Creating placements for the append partitioned tables on the coordinator is not allowed.")));
continue;
}
uint32 nodeGroupId = workerNode->groupId; uint32 nodeGroupId = workerNode->groupId;
char *nodeName = workerNode->workerName; char *nodeName = workerNode->workerName;
uint32 nodePort = workerNode->workerPort; uint32 nodePort = workerNode->workerPort;