mirror of https://github.com/citusdata/citus.git
Allow delegating function from worker nodes
We've both allowed delegating functions and procedures from worker nodes and also prevented delegation if a function/procedure has already been propagated from another node.pull/5415/head
parent
a8b1ee87f7
commit
6d849cf394
|
@ -62,7 +62,12 @@ CallDistributedProcedureRemotely(CallStmt *callStmt, DestReceiver *dest)
|
|||
DistObjectCacheEntry *procedure = LookupDistObjectCacheEntry(ProcedureRelationId,
|
||||
functionId, 0);
|
||||
|
||||
if (procedure == NULL || !procedure->isDistributed)
|
||||
/*
|
||||
* If procedure is not distributed or already delegated from another
|
||||
* node, do not call the procedure remotely.
|
||||
*/
|
||||
if (procedure == NULL || !procedure->isDistributed ||
|
||||
IsCitusInitiatedRemoteBackend())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -112,9 +112,18 @@ TryToDelegateFunctionCall(DistributedPlanningContext *planContext)
|
|||
}
|
||||
|
||||
int32 localGroupId = GetLocalGroupId();
|
||||
if (localGroupId != COORDINATOR_GROUP_ID || localGroupId == GROUP_ID_UPGRADING)
|
||||
if (localGroupId != COORDINATOR_GROUP_ID && IsCitusInitiatedRemoteBackend())
|
||||
{
|
||||
/* do not delegate from workers, or while upgrading */
|
||||
/*
|
||||
* Do not delegate from workers if it is initiated by Citus already.
|
||||
* It means that this function has already been delegated to this node.
|
||||
*/
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (localGroupId == GROUP_ID_UPGRADING)
|
||||
{
|
||||
/* do not delegate while upgrading */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue