From cc68e87903e49657dd3a62719b527df04e799348 Mon Sep 17 00:00:00 2001 From: Burak Velioglu Date: Tue, 28 Dec 2021 12:48:20 +0300 Subject: [PATCH] Citus indent --- .../distributed/commands/alter_table.c | 4 +- .../citus_add_local_table_to_metadata.c | 2 +- .../commands/create_distributed_table.c | 2 +- .../distributed/commands/dependencies.c | 7 ++-- .../distributed/metadata/node_metadata.c | 38 ++++++++++--------- .../distributed/utils/reference_table_utils.c | 2 +- .../distributed/worker/worker_drop_protocol.c | 4 +- 7 files changed, 31 insertions(+), 28 deletions(-) diff --git a/src/backend/distributed/commands/alter_table.c b/src/backend/distributed/commands/alter_table.c index a477788dd..0d08fe880 100644 --- a/src/backend/distributed/commands/alter_table.c +++ b/src/backend/distributed/commands/alter_table.c @@ -1354,8 +1354,8 @@ ReplaceTable(Oid sourceId, Oid targetId, List *justBeforeDropCommands, changeDependencyFor(RelationRelationId, sequenceOid, RelationRelationId, sourceId, targetId); - // Changing the dependency for sequence will prevent PG to have - // sequence within drop trigger + /* Changing the dependency for sequence will prevent PG to have */ + /* sequence within drop trigger */ if (conversionType == UNDISTRIBUTE_TABLE) { ObjectAddress sequenceAddress = { 0 }; diff --git a/src/backend/distributed/commands/citus_add_local_table_to_metadata.c b/src/backend/distributed/commands/citus_add_local_table_to_metadata.c index 4ba65fbf3..bb48a53a5 100644 --- a/src/backend/distributed/commands/citus_add_local_table_to_metadata.c +++ b/src/backend/distributed/commands/citus_add_local_table_to_metadata.c @@ -1250,7 +1250,7 @@ FinalizeCitusLocalTableCreation(Oid relationId, List *dependentSequenceList) } else { - // Mark the table as distributed only locally + /* Mark the table as distributed only locally */ bool prevDependencyCreationValue = EnableDependencyCreation; SetLocalEnableDependencyCreation(false); MarkObjectDistributed(&relationAddress); diff --git a/src/backend/distributed/commands/create_distributed_table.c b/src/backend/distributed/commands/create_distributed_table.c index da58e6182..588c4126d 100644 --- a/src/backend/distributed/commands/create_distributed_table.c +++ b/src/backend/distributed/commands/create_distributed_table.c @@ -540,7 +540,7 @@ CreateDistributedTable(Oid relationId, Var *distributionColumn, char distributio } else { - // Mark the table as distributed only locally + /* Mark the table as distributed only locally */ bool prevDependencyCreationValue = EnableDependencyCreation; SetLocalEnableDependencyCreation(false); MarkObjectDistributed(&tableAddress); diff --git a/src/backend/distributed/commands/dependencies.c b/src/backend/distributed/commands/dependencies.c index 50f02ec01..b4e128545 100644 --- a/src/backend/distributed/commands/dependencies.c +++ b/src/backend/distributed/commands/dependencies.c @@ -242,7 +242,7 @@ GetDependencyCreateDDLCommands(const ObjectAddress *dependency) if (IsCitusTable(relationId) && !IsTableOwnedByExtension(relationId)) { /* skip table metadata creation when the Citus table is owned by an extension */ - // TODO: Check sequence next val type + /* TODO: Check sequence next val type */ List *commandList = NIL; List *tableDDLCommands = GetFullTableCreationCommands(relationId, WORKER_NEXTVAL_SEQUENCE_DEFAULTS); @@ -266,7 +266,7 @@ GetDependencyCreateDDLCommands(const ObjectAddress *dependency) if (relKind == RELKIND_SEQUENCE) { - // TODO: Check user name for different scenarios + /* TODO: Check user name for different scenarios */ char *userName = GetUserNameFromId(GetUserId(), false); return DDLCommandsForSequence(dependency->objectId, userName); } @@ -403,7 +403,8 @@ ReplicateAllDependenciesToNode(const char *nodeName, int nodePort) ddlCommands = lcons(DISABLE_DDL_PROPAGATION, ddlCommands); ddlCommands = lappend(ddlCommands, ENABLE_DDL_PROPAGATION); - SendCommandListToWorkerOutsideTransaction(nodeName, nodePort, CitusExtensionOwnerName(), ddlCommands); + SendCommandListToWorkerOutsideTransaction(nodeName, nodePort, + CitusExtensionOwnerName(), ddlCommands); } diff --git a/src/backend/distributed/metadata/node_metadata.c b/src/backend/distributed/metadata/node_metadata.c index a4c66faab..8d4deacbc 100644 --- a/src/backend/distributed/metadata/node_metadata.c +++ b/src/backend/distributed/metadata/node_metadata.c @@ -823,12 +823,13 @@ ClearDistributedTablesFromNode(WorkerNode *workerNode) List *clearDistributedTablesCommandList = NIL; clearDistributedTablesCommandList = lappend(clearDistributedTablesCommandList, - REMOVE_ALL_CLUSTERED_TABLES_ONLY_COMMAND); + REMOVE_ALL_CLUSTERED_TABLES_ONLY_COMMAND); clearDistributedTablesCommandList = list_concat(list_make1(DISABLE_DDL_PROPAGATION), - clearDistributedTablesCommandList); - clearDistributedTablesCommandList = list_concat(clearDistributedTablesCommandList, list_make1( - ENABLE_DDL_PROPAGATION)); + clearDistributedTablesCommandList); + clearDistributedTablesCommandList = list_concat(clearDistributedTablesCommandList, + list_make1( + ENABLE_DDL_PROPAGATION)); SendCommandListToWorkerOutsideTransaction(workerNode->workerName, workerNode->workerPort, @@ -850,7 +851,7 @@ ClearDistributedObjectsAndIntegrationsFromNode(WorkerNode *workerNode) detachPartitionCommandList); clearDistTableInfoCommandList = lappend(clearDistTableInfoCommandList, - REMOVE_ALL_CLUSTERED_TABLES_METADATA_ONLY_COMMAND); + REMOVE_ALL_CLUSTERED_TABLES_METADATA_ONLY_COMMAND); clearDistTableInfoCommandList = lappend(clearDistTableInfoCommandList, DELETE_ALL_DISTRIBUTED_OBJECTS); @@ -862,9 +863,9 @@ ClearDistributedObjectsAndIntegrationsFromNode(WorkerNode *workerNode) char *currentUser = CurrentUserName(); SendMetadataCommandListToWorkerInCoordinatedTransaction(workerNode->workerName, - workerNode->workerPort, - currentUser, - clearDistTableInfoCommandList); + workerNode->workerPort, + currentUser, + clearDistTableInfoCommandList); } @@ -906,14 +907,15 @@ SetUpDistributedTableWithDependencies(WorkerNode *newWorkerNode) * We prefer this because otherwise node activation might fail within * transaction blocks. */ - // TODO: Doesn't make sense to have that here as we won't handle placement metadata - // with maintenance daemon anymore + /* TODO: Doesn't make sense to have that here as we won't handle placement metadata */ + /* with maintenance daemon anymore */ + /* if (ClusterHasDistributedFunctionWithDistArgument()) - { - SetWorkerColumnLocalOnly(newWorkerNode, Anum_pg_dist_node_hasmetadata, - BoolGetDatum(true)); - TriggerMetadataSyncOnCommit(); - }*/ + * { + * SetWorkerColumnLocalOnly(newWorkerNode, Anum_pg_dist_node_hasmetadata, + * BoolGetDatum(true)); + * TriggerMetadataSyncOnCommit(); + * }*/ } } @@ -1191,9 +1193,9 @@ ActivateNode(char *nodeName, int nodePort) } /* - * Delete replicated table placements from the coordinator's metadata, - * including remote ones. - */ + * Delete replicated table placements from the coordinator's metadata, + * including remote ones. + */ bool forceRemoteDelete = true; DeleteAllReplicatedTablePlacementsFromNodeGroup(workerNode->groupId, forceRemoteDelete); diff --git a/src/backend/distributed/utils/reference_table_utils.c b/src/backend/distributed/utils/reference_table_utils.c index fe333aab4..ccd482f8b 100644 --- a/src/backend/distributed/utils/reference_table_utils.c +++ b/src/backend/distributed/utils/reference_table_utils.c @@ -539,7 +539,7 @@ ReferenceTableReplicationFactor(void) * table to update the replication factor column when necessary. This function * skips reference tables if that node already has healthy placement of that * reference table to prevent unnecessary data transfer. - * + * * TODO: Make is static and updatr comment */ void diff --git a/src/backend/distributed/worker/worker_drop_protocol.c b/src/backend/distributed/worker/worker_drop_protocol.c index f5d443f49..14381cd75 100644 --- a/src/backend/distributed/worker/worker_drop_protocol.c +++ b/src/backend/distributed/worker/worker_drop_protocol.c @@ -249,7 +249,7 @@ worker_drop_distributed_table_only(PG_FUNCTION_ARGS) /* - * worker_drop_distributed_table_metadata_only removes the associated rows from pg_dist_partition, + * worker_drop_distributed_table_metadata_only removes the associated rows from pg_dist_partition, * pg_dist_shard and pg_dist_placement for the given relation. */ Datum @@ -283,4 +283,4 @@ worker_drop_distributed_table_metadata_only(PG_FUNCTION_ARGS) DeletePartitionRow(relationId); PG_RETURN_VOID(); -} \ No newline at end of file +}