mirror of https://github.com/citusdata/citus.git
Rename WorkersContainingAllShards to PlacementsForWorkersContainingAllShards
parent
080f711e62
commit
4f7989ad8e
|
@ -2646,7 +2646,7 @@ QueryPushdownTaskCreate(Query *originalQuery, int shardIndex,
|
|||
|
||||
Assert(anchorShardId != INVALID_SHARD_ID);
|
||||
|
||||
List *selectPlacementList = WorkersContainingAllShards(taskShardList);
|
||||
List *selectPlacementList = PlacementsForWorkersContainingAllShards(taskShardList);
|
||||
if (list_length(selectPlacementList) == 0)
|
||||
{
|
||||
ereport(ERROR, (errmsg("cannot find a worker that has active placements for all "
|
||||
|
|
|
@ -2197,7 +2197,8 @@ CreateTaskPlacementListForShardIntervals(List *shardIntervalListList, bool shard
|
|||
/*
|
||||
* Determine the workers that have all shard placements, if any.
|
||||
*/
|
||||
List *workerList = WorkersContainingAllShards(shardIntervalListList);
|
||||
List *shardPlacementList =
|
||||
PlacementsForWorkersContainingAllShards(shardIntervalListList);
|
||||
|
||||
if (hasLocalRelation)
|
||||
{
|
||||
|
@ -2207,9 +2208,8 @@ CreateTaskPlacementListForShardIntervals(List *shardIntervalListList, bool shard
|
|||
* If there is a local table, we only allow the local placement to
|
||||
* be used. If there is none, we disallow the query.
|
||||
*/
|
||||
foreach_ptr(taskPlacement, workerList)
|
||||
foreach_ptr(taskPlacement, shardPlacementList)
|
||||
{
|
||||
/* include only the local placement */
|
||||
if (taskPlacement->groupId == GetLocalGroupId())
|
||||
{
|
||||
placementList = lappend(placementList, taskPlacement);
|
||||
|
@ -2218,7 +2218,7 @@ CreateTaskPlacementListForShardIntervals(List *shardIntervalListList, bool shard
|
|||
}
|
||||
else
|
||||
{
|
||||
placementList = workerList;
|
||||
placementList = shardPlacementList;
|
||||
}
|
||||
}
|
||||
else if (generateDummyPlacement)
|
||||
|
@ -2586,22 +2586,18 @@ RelationPrunesToMultipleShards(List *relationShardList)
|
|||
|
||||
|
||||
/*
|
||||
* WorkersContainingSelectShards returns list of shard placements that contain all
|
||||
* shard intervals provided to the select query. It returns NIL if no placement
|
||||
* exists. The caller should check if there are any shard intervals exist for
|
||||
* placement check prior to calling this function.
|
||||
* PlacementsForWorkersContainingAllShards returns list of shard placements for workers
|
||||
* that contain all shard intervals in the given list of shard interval lists.
|
||||
*/
|
||||
List *
|
||||
WorkersContainingAllShards(List *prunedShardIntervalsList)
|
||||
PlacementsForWorkersContainingAllShards(List *shardIntervalListList)
|
||||
{
|
||||
ListCell *prunedShardIntervalCell = NULL;
|
||||
bool firstShard = true;
|
||||
List *currentPlacementList = NIL;
|
||||
List *shardIntervalList = NIL;
|
||||
|
||||
foreach(prunedShardIntervalCell, prunedShardIntervalsList)
|
||||
foreach_ptr(shardIntervalList, shardIntervalListList)
|
||||
{
|
||||
List *shardIntervalList = (List *) lfirst(prunedShardIntervalCell);
|
||||
|
||||
if (shardIntervalList == NIL)
|
||||
{
|
||||
continue;
|
||||
|
|
|
@ -56,7 +56,7 @@ extern List * TargetShardIntervalsForRestrictInfo(RelationRestrictionContext *
|
|||
restrictionContext,
|
||||
bool *multiShardQuery,
|
||||
Const **partitionValueConst);
|
||||
extern List * WorkersContainingAllShards(List *prunedShardIntervalsList);
|
||||
extern List * PlacementsForWorkersContainingAllShards(List *shardIntervalListList);
|
||||
extern List * IntersectPlacementList(List *lhsPlacementList, List *rhsPlacementList);
|
||||
extern DeferredErrorMessage * ModifyQuerySupported(Query *queryTree, Query *originalQuery,
|
||||
bool multiShardQuery,
|
||||
|
|
Loading…
Reference in New Issue