mirror of https://github.com/citusdata/citus.git
Citus indent
parent
e610a147a1
commit
cc68e87903
|
@ -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 };
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue