Sync metadata first before propagating any

velioglu/wo_seq_test_1
Burak Velioglu 2021-12-18 20:25:09 +03:00
parent f66b1d5116
commit 3d828bc7b6
No known key found for this signature in database
GPG Key ID: F6827E620F6549C6
1 changed files with 6 additions and 13 deletions

View File

@ -1134,12 +1134,6 @@ ActivateNode(char *nodeName, int nodePort)
{
bool isActive = true;
CheckCitusVersion(ERROR);
EnsureCoordinator();
EnsureModificationsCanRun();
EnsureSequentialModeMetadataOperations();
/* take an exclusive lock on pg_dist_node to serialize pg_dist_node changes */
LockRelationOid(DistNodeRelationId(), ExclusiveLock);
@ -1169,16 +1163,15 @@ ActivateNode(char *nodeName, int nodePort)
BoolGetDatum(isActive));
}
UseCoordinatedTransaction();
ClearDistributedObjectsWithMetadataFromNode(workerNode);
SetUpDistributedTableWithDependencies(workerNode);
SetUpMultipleDistributedTableIntegrations(workerNode);
SetUpObjectMetadata(workerNode);
if (syncMetadata)
{
StartMetadataSyncToNode(nodeName, nodePort);
// TODO: Consider calling function below according to state
ClearDistributedObjectsWithMetadataFromNode(workerNode);
SetUpDistributedTableWithDependencies(workerNode);
SetUpMultipleDistributedTableIntegrations(workerNode);
SetUpObjectMetadata(workerNode);
}
/* finally, let all other active metadata nodes to learn about this change */