Object distribution change

velioglu/wo_seq_test_1
Burak Velioglu 2021-12-22 11:19:34 +03:00
parent 9fe1c9646d
commit d66f1243bf
No known key found for this signature in database
GPG Key ID: F6827E620F6549C6
1 changed files with 14 additions and 9 deletions

View File

@ -367,13 +367,6 @@ CreateCitusLocalTable(Oid relationId, bool cascadeViaForeignKeys, bool autoConve
InsertMetadataForCitusLocalTable(shellRelationId, shardId, autoConverted); InsertMetadataForCitusLocalTable(shellRelationId, shardId, autoConverted);
FinalizeCitusLocalTableCreation(shellRelationId, dependentSequenceList); FinalizeCitusLocalTableCreation(shellRelationId, dependentSequenceList);
/*
* Mark the shell relation as distributed on each node as the last step.
*/
ObjectAddress shellRelationAddress = { 0 };
ObjectAddressSet(shellRelationAddress, RelationRelationId, shellRelationId);
MarkObjectDistributed(&shellRelationAddress);
} }
@ -1246,11 +1239,23 @@ FinalizeCitusLocalTableCreation(Oid relationId, List *dependentSequenceList)
CreateTruncateTrigger(relationId); CreateTruncateTrigger(relationId);
} }
CreateShellTableOnWorkers(relationId); ObjectAddress relationAddress = { 0 };
ObjectAddressSet(relationAddress, RelationRelationId, relationId);
if (ShouldSyncTableMetadata(relationId)) if (ShouldSyncTableMetadata(relationId))
{ {
CreateShellTableOnWorkers(relationId);
CreateTableMetadataOnWorkers(relationId); CreateTableMetadataOnWorkers(relationId);
MarkObjectDistributed(&relationAddress);
}
else
{
// Mark the table as distributed only locally
bool prevDependencyCreationValue = EnableDependencyCreation;
SetLocalEnableDependencyCreation(false);
MarkObjectDistributed(&relationAddress);
SetLocalEnableDependencyCreation(prevDependencyCreationValue);
} }
/* /*