mirror of https://github.com/citusdata/citus.git
Fix assert failure introduced in 245a62df3e
The assert on the number of shards incorrectly used the value of citus.shard_replication_factor; it should check the table's metadata to determine the replication factor of its data, and not assume it is the current GUC value.pull/8075/head
parent
9327df8446
commit
f1160b0892
|
|
@ -2060,14 +2060,6 @@ CheckAndBuildDelayedFastPathPlan(DistributedPlanningContext *planContext,
|
|||
Task *task = (Task *) linitial(tasks);
|
||||
List *placements = task->taskPlacementList;
|
||||
int32 localGroupId = GetLocalGroupId();
|
||||
|
||||
/*
|
||||
* Today FastPathRouterQuery() doesn't set delayFastPathPlanning to true for
|
||||
* reference tables. We should be looking at 1 placement, or ShardReplicationFactor
|
||||
* of them.
|
||||
*/
|
||||
Assert(list_length(placements) == 1 || list_length(placements) ==
|
||||
ShardReplicationFactor);
|
||||
ShardPlacement *primaryPlacement = (ShardPlacement *) linitial(placements);
|
||||
|
||||
bool isLocalExecution = !IsDummyPlacement(primaryPlacement) &&
|
||||
|
|
@ -2081,6 +2073,14 @@ CheckAndBuildDelayedFastPathPlan(DistributedPlanningContext *planContext,
|
|||
RelationShard *relationShard = (RelationShard *) linitial(relationShards);
|
||||
Assert(relationShard->shardId == primaryPlacement->shardId);
|
||||
|
||||
/*
|
||||
* Today FastPathRouterQuery() doesn't set delayFastPathPlanning to true for
|
||||
* reference tables. We should be looking at 1 placement, or their replication
|
||||
* factor.
|
||||
*/
|
||||
Assert(list_length(placements) == 1 || list_length(placements) ==
|
||||
TableShardReplicationFactor(relationShard->relationId));
|
||||
|
||||
canBuildLocalPlan = ConvertToQueryOnShard(planContext->query,
|
||||
relationShard->relationId,
|
||||
relationShard->shardId);
|
||||
|
|
|
|||
Loading…
Reference in New Issue