Indentation fix

velioglu/wo_seq_test_1
Burak Velioglu 2021-12-20 12:30:36 +03:00
parent 303c7e230e
commit ab29b939b2
No known key found for this signature in database
GPG Key ID: F6827E620F6549C6
4 changed files with 50 additions and 31 deletions

View File

@ -64,7 +64,8 @@ EnsureDependenciesExistOnAllNodes(const ObjectAddress *target)
List *dependencyCommands = GetDependencyCreateDDLCommands(dependency);
ddlCommands = list_concat(ddlCommands, dependencyCommands);
// TODO: Might add check for tables
/* TODO: Might add check for tables */
/* create a new list with dependencies that actually created commands */
if (list_length(dependencyCommands) > 0)
{
@ -243,17 +244,20 @@ GetDependencyCreateDDLCommands(const ObjectAddress *dependency)
{
/* skip table metadata creation when the Citus table is owned by an extension */
List *commandList = NIL;
List *tableDDLCommands = GetFullTableCreationCommands(relationId, WORKER_NEXTVAL_SEQUENCE_DEFAULTS);
List *tableDDLCommands = GetFullTableCreationCommands(relationId,
WORKER_NEXTVAL_SEQUENCE_DEFAULTS);
TableDDLCommand *tableDDLCommand = NULL;
foreach_ptr(tableDDLCommand, tableDDLCommands)
{
Assert(CitusIsA(tableDDLCommand, TableDDLCommand));
commandList = lappend(commandList, GetTableDDLCommand(tableDDLCommand));
commandList = lappend(commandList, GetTableDDLCommand(
tableDDLCommand));
}
// TODO: May need to move sequence dependencies to ActiveNode directly
List *sequenceDependencyCommandList = SequenceDependencyCommandList(dependency->objectId);
/* TODO: May need to move sequence dependencies to ActiveNode directly */
List *sequenceDependencyCommandList = SequenceDependencyCommandList(
dependency->objectId);
commandList = list_concat(commandList, sequenceDependencyCommandList);
return commandList;
@ -265,6 +269,9 @@ GetDependencyCreateDDLCommands(const ObjectAddress *dependency)
char *userName = GetUserNameFromId(GetUserId(), false);
return DDLCommandsForSequence(dependency->objectId, userName);
}
/* if this relation is not supported, break to the error at the end */
break;
}
case OCLASS_COLLATION:
@ -395,7 +402,9 @@ ReplicateAllDependenciesToNode(const char *nodeName, int nodePort)
ddlCommands = lcons(DISABLE_DDL_PROPAGATION, ddlCommands);
ddlCommands = lappend(ddlCommands, ENABLE_DDL_PROPAGATION);
SendMetadataCommandListToWorkerInCoordinatedTransaction(nodeName, nodePort, CitusExtensionOwnerName(), ddlCommands);
SendMetadataCommandListToWorkerInCoordinatedTransaction(nodeName, nodePort,
CitusExtensionOwnerName(),
ddlCommands);
}

View File

@ -677,11 +677,13 @@ SupportedDependencyByCitus(const ObjectAddress *address)
*/
if (relKind == RELKIND_COMPOSITE_TYPE ||
relKind == RELKIND_RELATION ||
relKind == RELKIND_PARTITIONED_TABLE || // TODO: Should check for normal tables?
relKind == RELKIND_PARTITIONED_TABLE || /* TODO: Should check for normal tables? */
relKind == RELKIND_SEQUENCE)
{
return true;
}
return false;
}
default:

View File

@ -1819,7 +1819,6 @@ CreateTableMetadataOnWorkers(Oid relationId)
}
/*
* SyncMetadataToNodes tries recreating the metadata snapshot in the
* metadata workers that are out of sync. Returns the result of

View File

@ -656,8 +656,10 @@ SetUpMultipleDistributedTableIntegrations(WorkerNode *workerNode)
}
char *currentUser = CurrentUserName();
multipleTableIntegrationCommandList = lcons(DISABLE_DDL_PROPAGATION, multipleTableIntegrationCommandList);
multipleTableIntegrationCommandList = lappend(multipleTableIntegrationCommandList, ENABLE_DDL_PROPAGATION);
multipleTableIntegrationCommandList = lcons(DISABLE_DDL_PROPAGATION,
multipleTableIntegrationCommandList);
multipleTableIntegrationCommandList = lappend(multipleTableIntegrationCommandList,
ENABLE_DDL_PROPAGATION);
SendMetadataCommandListToWorkerInCoordinatedTransaction(workerNode->workerName,
workerNode->workerPort,
currentUser,
@ -719,8 +721,10 @@ SetUpObjectMetadata(WorkerNode *workerNode)
distributedObjectSyncCommandList);
}
metadataSnapshotCommandList = lcons(DISABLE_DDL_PROPAGATION, metadataSnapshotCommandList);
metadataSnapshotCommandList = lappend(metadataSnapshotCommandList, ENABLE_DDL_PROPAGATION);
metadataSnapshotCommandList = lcons(DISABLE_DDL_PROPAGATION,
metadataSnapshotCommandList);
metadataSnapshotCommandList = lappend(metadataSnapshotCommandList,
ENABLE_DDL_PROPAGATION);
char *currentUser = CurrentUserName();
SendMetadataCommandListToWorkerInCoordinatedTransaction(workerNode->workerName,
@ -835,10 +839,13 @@ ClearDistributedObjectsWithMetadataFromNode(WorkerNode *workerNode)
clearDistTableInfoCommandList = lappend(clearDistTableInfoCommandList,
REMOVE_ALL_CLUSTERED_TABLES_COMMAND);
clearDistTableInfoCommandList = lappend(clearDistTableInfoCommandList, DELETE_ALL_DISTRIBUTED_OBJECTS);
clearDistTableInfoCommandList = lappend(clearDistTableInfoCommandList,
DELETE_ALL_DISTRIBUTED_OBJECTS);
clearDistTableInfoCommandList = list_concat(list_make1(DISABLE_DDL_PROPAGATION),clearDistTableInfoCommandList);
clearDistTableInfoCommandList = list_concat(clearDistTableInfoCommandList, list_make1(ENABLE_DDL_PROPAGATION));
clearDistTableInfoCommandList = list_concat(list_make1(DISABLE_DDL_PROPAGATION),
clearDistTableInfoCommandList);
clearDistTableInfoCommandList = list_concat(clearDistTableInfoCommandList, list_make1(
ENABLE_DDL_PROPAGATION));
char *currentUser = CurrentUserName();
SendMetadataCommandListToWorkerInCoordinatedTransaction(workerNode->workerName,
@ -1185,8 +1192,8 @@ ActivateNode(char *nodeName, int nodePort)
*/
if (workerNode->groupId != COORDINATOR_GROUP_ID)
{
// TODO: Consider calling function below according to other states like primary/secondary
// Should we check syncMetadata always on as well?
/* TODO: Consider calling function below according to other states like primary/secondary */
/* Should we check syncMetadata always on as well? */
ClearDistributedObjectsWithMetadataFromNode(workerNode);
SetUpDistributedTableWithDependencies(workerNode);
SetUpMultipleDistributedTableIntegrations(workerNode);
@ -1206,6 +1213,7 @@ ActivateNode(char *nodeName, int nodePort)
return newWorkerNode->nodeId;
}
/*
* DetachPartitionCommandList returns list of DETACH commands to detach partitions
* of all distributed tables. This function is used for detaching partitions in MX
@ -1242,7 +1250,8 @@ DetachPartitionCommandList(void)
return NIL;
}
detachPartitionCommandList = lcons(DISABLE_DDL_PROPAGATION, detachPartitionCommandList);
detachPartitionCommandList = lcons(DISABLE_DDL_PROPAGATION,
detachPartitionCommandList);
/*
* We probably do not need this but as an extra precaution, we are enabling