Third commit to change APIs

metadata_sync_imp
Onder Kalaci 2022-11-28 09:53:18 +01:00
parent 3f72a6c1d2
commit 793f729808
1 changed files with 14 additions and 13 deletions

View File

@ -103,7 +103,7 @@ static void DeleteNodeRow(char *nodename, int32 nodeport);
static void SyncDistributedObjectsToNodeList(List *workerNodeList); static void SyncDistributedObjectsToNodeList(List *workerNodeList);
static void UpdateLocalGroupIdOnNode(WorkerNode *workerNode); static void UpdateLocalGroupIdOnNode(WorkerNode *workerNode);
static void SyncPgDistTableMetadataToNodeList(List *nodeList); static void SyncPgDistTableMetadataToNodeList(List *nodeList);
static List * InterTableRelationshipCommandList(); static void InterTableRelationshipCommandList(List **ddlCommandList);
static void BlockDistributedQueriesOnMetadataNodes(void); static void BlockDistributedQueriesOnMetadataNodes(void);
static WorkerNode * TupleToWorkerNode(TupleDesc tupleDescriptor, HeapTuple heapTuple); static WorkerNode * TupleToWorkerNode(TupleDesc tupleDescriptor, HeapTuple heapTuple);
static void PropagateNodeWideObjectsCommandList(List **nodeWideObjectCommandList); static void PropagateNodeWideObjectsCommandList(List **nodeWideObjectCommandList);
@ -652,12 +652,11 @@ master_set_node_property(PG_FUNCTION_ARGS)
* *
* for each citus table. * for each citus table.
*/ */
static List * static void
InterTableRelationshipCommandList() InterTableRelationshipCommandList(List **multipleTableIntegrationCommandList)
{ {
List *distributedTableList = CitusTableList(); List *distributedTableList = CitusTableList();
List *propagatedTableList = NIL; List *propagatedTableList = NIL;
List *multipleTableIntegrationCommandList = NIL;
CitusTableCacheEntry *cacheEntry = NULL; CitusTableCacheEntry *cacheEntry = NULL;
foreach_ptr(cacheEntry, distributedTableList) foreach_ptr(cacheEntry, distributedTableList)
@ -680,17 +679,15 @@ InterTableRelationshipCommandList()
List *commandListForRelation = List *commandListForRelation =
InterTableRelationshipOfRelationCommandList(relationId); InterTableRelationshipOfRelationCommandList(relationId);
multipleTableIntegrationCommandList = list_concat( *multipleTableIntegrationCommandList = list_concat(
multipleTableIntegrationCommandList, *multipleTableIntegrationCommandList,
commandListForRelation); commandListForRelation);
} }
multipleTableIntegrationCommandList = lcons(DISABLE_DDL_PROPAGATION, *multipleTableIntegrationCommandList = lcons(DISABLE_DDL_PROPAGATION,
multipleTableIntegrationCommandList); *multipleTableIntegrationCommandList);
multipleTableIntegrationCommandList = lappend(multipleTableIntegrationCommandList, *multipleTableIntegrationCommandList = lappend(*multipleTableIntegrationCommandList,
ENABLE_DDL_PROPAGATION); ENABLE_DDL_PROPAGATION);
return multipleTableIntegrationCommandList;
} }
@ -836,7 +833,11 @@ SyncDistributedObjectsCommandList(WorkerNode *workerNode, List **commandList)
* After creating each table, handle the inter table relationship between * After creating each table, handle the inter table relationship between
* those tables. * those tables.
*/ */
*commandList = list_concat(*commandList, InterTableRelationshipCommandList()); List *interTableRelationshipCommandList = NIL;
InterTableRelationshipCommandList(&interTableRelationshipCommandList);
*commandList = list_concat(*commandList, interTableRelationshipCommandList);
return *commandList; return *commandList;
} }