Move shell table creation out

velioglu/wo_seq_test_1
Burak Velioglu 2021-12-18 21:28:24 +03:00
parent 3d828bc7b6
commit b9d1ab38af
No known key found for this signature in database
GPG Key ID: F6827E620F6549C6
4 changed files with 6 additions and 8 deletions

View File

@ -450,10 +450,11 @@ CreateDistributedTable(Oid relationId, Var *distributionColumn, char distributio
ObjectAddressSet(tableAddress, RelationRelationId, relationId); ObjectAddressSet(tableAddress, RelationRelationId, relationId);
EnsureDependenciesExistOnAllNodes(&tableAddress); EnsureDependenciesExistOnAllNodes(&tableAddress);
CreateShellTableOnWorkers(relationId);
/* TODO: Consider partitioned tables */ /* TODO: Consider partitioned tables */
if (ShouldSyncTableMetadata(relationId)) if (EnableDependencyCreation)
{ {
CreateShellTableOnWorkers(relationId);
MarkObjectDistributed(&tableAddress); MarkObjectDistributed(&tableAddress);
} }

View File

@ -1459,8 +1459,6 @@ ShouldShutdownConnection(MultiConnection *connection, const int cachedConnection
bool bool
IsCitusInitiatedRemoteBackend(void) IsCitusInitiatedRemoteBackend(void)
{ {
elog(WARNING, "IsCitusInitiatedRemoteBackend");
elog(WARNING, "Application name is %s", application_name);
return application_name && strcmp(application_name, CITUS_APPLICATION_NAME) == 0; return application_name && strcmp(application_name, CITUS_APPLICATION_NAME) == 0;
} }

View File

@ -676,7 +676,7 @@ SupportedDependencyByCitus(const ObjectAddress *address)
* for tables. * for tables.
*/ */
if (relKind == RELKIND_COMPOSITE_TYPE || if (relKind == RELKIND_COMPOSITE_TYPE ||
(relKind == RELKIND_RELATION && IsCitusTable(address->objectId)) || relKind == RELKIND_RELATION || // TODO: Should check for normal tables?
relKind == RELKIND_SEQUENCE) relKind == RELKIND_SEQUENCE)
{ {
return true; return true;

View File

@ -538,9 +538,8 @@ MetadataCreateCommands(void)
/* /*
* GetDistributedTableMetadataEvents returns the full set of DDL commands necessary to * GetDistributedTableMetadataEvents returns the full set of DDL commands necessary to
* create the given distributed table on a worker. The list includes setting up any * create the given distributed table metadata on a worker. The list includes setting up
* sequences, setting the owner of the table, inserting table and shard metadata, * any shard metadata, setting the truncate trigger and foreign key constraints.
* setting the truncate trigger and foreign key constraints.
*/ */
static List * static List *
GetDistributedTableMetadataEvents(Oid relationId) GetDistributedTableMetadataEvents(Oid relationId)