remove useless code block (#7158)

pull/7153/head^2
zhjwpku 2023-08-29 23:15:22 +08:00 committed by GitHub
parent a17fae36b9
commit f03291a8c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 9 deletions

View File

@ -390,12 +390,11 @@ InsertShardPlacementRows(Oid relationId, int64 shardId, List *workerNodeList,
int workerStartIndex, int replicationFactor)
{
int workerNodeCount = list_length(workerNodeList);
int placementsInserted = 0;
List *insertedShardPlacements = NIL;
for (int attemptNumber = 0; attemptNumber < replicationFactor; attemptNumber++)
for (int placementIndex = 0; placementIndex < replicationFactor; placementIndex++)
{
int workerNodeIndex = (workerStartIndex + attemptNumber) % workerNodeCount;
int workerNodeIndex = (workerStartIndex + placementIndex) % workerNodeCount;
WorkerNode *workerNode = (WorkerNode *) list_nth(workerNodeList, workerNodeIndex);
uint32 nodeGroupId = workerNode->groupId;
const uint64 shardSize = 0;
@ -404,12 +403,6 @@ InsertShardPlacementRows(Oid relationId, int64 shardId, List *workerNodeList,
shardSize, nodeGroupId);
ShardPlacement *shardPlacement = LoadShardPlacement(shardId, shardPlacementId);
insertedShardPlacements = lappend(insertedShardPlacements, shardPlacement);
placementsInserted++;
if (placementsInserted >= replicationFactor)
{
break;
}
}
return insertedShardPlacements;