fix non-blocking shardsplits double shardgroup id consumption

feature/shardgroup
Nils Dijk 2023-12-01 15:07:00 +00:00
parent aa84309948
commit 31b5de42b4
No known key found for this signature in database
GPG Key ID: CA1177EF9434F241
1 changed files with 0 additions and 37 deletions

View File

@ -132,7 +132,6 @@ static void UpdateDistributionColumnsForShardGroup(List *colocatedShardList,
char distributionMethod,
int shardCount,
uint32 colocationId);
static void PopulateShardgroupIdsWithNewIds(List *shardGroupSplitIntervalListList);
static void InsertSplitChildrenShardgroupMetadata(List *shardGroupSplitIntervalListList);
static void InsertSplitChildrenShardMetadata(List *shardGroupSplitIntervalListList,
List *workersForPlacementList);
@ -632,9 +631,6 @@ BlockingShardSplit(SplitOperation splitOperation,
DropShardListMetadata(sourceColocatedShardIntervalList);
/* allocate and assign new shardgroups to newly created shardIntervals */
PopulateShardgroupIdsWithNewIds(shardGroupSplitIntervalListList);
InsertSplitChildrenShardgroupMetadata(shardGroupSplitIntervalListList);
/* Insert new shard and placement metdata */
@ -1219,39 +1215,6 @@ UpdateDistributionColumnsForShardGroup(List *colocatedShardList,
}
static void
PopulateShardgroupIdsWithNewIds(List *shardGroupSplitIntervalListList)
{
List *firstShardIntervals = NULL;
List *currentShardIntervals = NULL;
foreach_ptr(currentShardIntervals, shardGroupSplitIntervalListList)
{
if (!firstShardIntervals)
{
/* on the first loop we assign new shardgroupId's */
firstShardIntervals = currentShardIntervals;
ShardInterval *shardInterval = NULL;
foreach_ptr(shardInterval, firstShardIntervals)
{
ShardgroupID newShardgroupId = GetNextShardgroupId();
shardInterval->shardgroupId = newShardgroupId;
}
}
else
{
/* on subsequent loops we assign the same shardgroupId for colocation */
ShardInterval *firstShardInterval = NULL;
ShardInterval *currentShardInterval = NULL;
forboth_ptr(firstShardInterval, firstShardIntervals, currentShardInterval,
currentShardIntervals)
{
currentShardInterval->shardgroupId = firstShardInterval->shardgroupId;
}
}
}
}
static void
InsertSplitChildrenShardgroupMetadata(List *shardGroupSplitIntervalListList)
{