mirror of https://github.com/citusdata/citus.git
Make 2PC work when using LocalHostname
parent
9b2321fed5
commit
aad346602f
|
@ -1751,6 +1751,10 @@ citus_internal_mark_node_not_synced(PG_FUNCTION_ARGS)
|
||||||
/*
|
/*
|
||||||
* FindWorkerNode searches over the worker nodes and returns the workerNode
|
* FindWorkerNode searches over the worker nodes and returns the workerNode
|
||||||
* if it already exists. Else, the function returns NULL.
|
* if it already exists. Else, the function returns NULL.
|
||||||
|
*
|
||||||
|
* NOTE: A special case that this handles is when nodeName and nodePort are set
|
||||||
|
* to LocalHostName and PostPortNumber. In that case we return the primary node
|
||||||
|
* for the local group.
|
||||||
*/
|
*/
|
||||||
WorkerNode *
|
WorkerNode *
|
||||||
FindWorkerNode(const char *nodeName, int32 nodePort)
|
FindWorkerNode(const char *nodeName, int32 nodePort)
|
||||||
|
@ -1773,6 +1777,11 @@ FindWorkerNode(const char *nodeName, int32 nodePort)
|
||||||
return workerNode;
|
return workerNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (strcmp(LocalHostName, nodeName) == 0 && nodePort == PostPortNumber)
|
||||||
|
{
|
||||||
|
return PrimaryNodeForGroup(GetLocalGroupId(), NULL);
|
||||||
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue