mirror of https://github.com/citusdata/citus.git
Go through the cache code for non-local queries as a no-op
At least, break the hard dependency for local shardsremote_prepared_txes
parent
bafd0c00f6
commit
ecd0af1e72
|
@ -67,13 +67,18 @@ CacheFastPathPlanForShardQuery(Task *task, DistributedPlan *originalDistributedP
|
|||
* functions/params to have been evaluated in the cached plan.
|
||||
*/
|
||||
Query *jobQuery = copyObject(originalDistributedPlan->workerJob->jobQuery);
|
||||
PlannedStmt *localPlan = NULL;
|
||||
|
||||
Query *localShardQuery = GetLocalShardQueryForCache(jobQuery, task, paramListInfo);
|
||||
if (TaskAccessesLocalNode(task))
|
||||
{
|
||||
Query *localShardQuery =
|
||||
GetLocalShardQueryForCache(jobQuery, task, paramListInfo);
|
||||
|
||||
LOCKMODE lockMode = GetQueryLockMode(localShardQuery);
|
||||
|
||||
/* fast path queries can only have a single RTE by definition */
|
||||
RangeTblEntry *rangeTableEntry = (RangeTblEntry *) linitial(localShardQuery->rtable);
|
||||
RangeTblEntry *rangeTableEntry =
|
||||
(RangeTblEntry *) linitial(localShardQuery->rtable);
|
||||
|
||||
/*
|
||||
* If the shard has been created in this transction, we wouldn't see the relationId
|
||||
|
@ -89,8 +94,12 @@ CacheFastPathPlanForShardQuery(Task *task, DistributedPlan *originalDistributedP
|
|||
|
||||
LockRelationOid(rangeTableEntry->relid, lockMode);
|
||||
|
||||
localPlan = planner(localShardQuery, NULL, 0, NULL);
|
||||
}
|
||||
else
|
||||
{ }
|
||||
|
||||
FastPathPlanCache *fastPathPlanCache = CitusMakeNode(FastPathPlanCache);
|
||||
PlannedStmt *localPlan = planner(localShardQuery, NULL, 0, NULL);
|
||||
fastPathPlanCache->localPlan = localPlan;
|
||||
fastPathPlanCache->shardId = task->anchorShardId;
|
||||
fastPathPlanCache->placementGroupIds = TaskGroupIdAccesses(task);
|
||||
|
@ -318,15 +327,6 @@ IsFastPathPlanCachingSupported(Job *currentJob, DistributedPlan *originalDistrib
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!TaskAccessesLocalNode(linitial(taskList)))
|
||||
{
|
||||
/*
|
||||
* TODO: we'll remove this, but for the tests not to
|
||||
* break, keep on this temp commit.
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
|
||||
Query *originalJobQuery = originalDistributedPlan->workerJob->jobQuery;
|
||||
if (contain_volatile_functions((Node *) originalJobQuery))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue