mirror of https://github.com/citusdata/citus.git
Move sync node metadata to above
parent
0932ea9a46
commit
632d7b8038
|
@ -1124,32 +1124,22 @@ ActivateNode(char *nodeName, int nodePort)
|
||||||
|
|
||||||
if (syncMetadata)
|
if (syncMetadata)
|
||||||
{
|
{
|
||||||
/*
|
SyncNodeMetadataToNode(nodeName, nodePort);
|
||||||
* We are going to sync the metadata anyway in this transaction, so do
|
|
||||||
* not fail just because the current metadata is not synced.
|
|
||||||
*/
|
|
||||||
SetWorkerColumn(workerNode, Anum_pg_dist_node_metadatasynced,
|
|
||||||
BoolGetDatum(true));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SetUpDistributedTableWithDependencies(workerNode);
|
SetUpDistributedTableWithDependencies(workerNode);
|
||||||
|
|
||||||
if (syncMetadata)
|
if (syncMetadata && !NodeIsCoordinator(workerNode))
|
||||||
{
|
{
|
||||||
SyncNodeMetadataToNode(nodeName, nodePort);
|
List *metadataUpdateCommandList = ResyncMetadataCommandList();
|
||||||
|
|
||||||
if (!NodeIsCoordinator(workerNode))
|
/* send commands to the new worker, the current user should be a superuser */
|
||||||
{
|
Assert(superuser());
|
||||||
List *metadataUpdateCommandList = ResyncMetadataCommandList();
|
SendMetadataCommandListToWorkerInCoordinatedTransaction(
|
||||||
|
workerNode->workerName,
|
||||||
/* send commands to the new worker, the current user should be a superuser */
|
workerNode->workerPort,
|
||||||
Assert(superuser());
|
CurrentUserName(),
|
||||||
SendMetadataCommandListToWorkerInCoordinatedTransaction(
|
metadataUpdateCommandList);
|
||||||
workerNode->workerName,
|
|
||||||
workerNode->workerPort,
|
|
||||||
CurrentUserName(),
|
|
||||||
metadataUpdateCommandList);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* finally, let all other active metadata nodes to learn about this change */
|
/* finally, let all other active metadata nodes to learn about this change */
|
||||||
|
|
Loading…
Reference in New Issue