mirror of https://github.com/citusdata/citus.git
fix non-blocking shardsplits double shardgroup id consumption
parent
aa84309948
commit
31b5de42b4
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue