mirror of https://github.com/citusdata/citus.git
Avoid assertion failure on citus_add_node
(cherry picked from commit 010a2a408e
)
release-11.0-onder-30-may
parent
4b5f749c23
commit
d147d5d0c5
|
@ -746,8 +746,6 @@ PgDistTableMetadataSyncCommandList(void)
|
||||||
metadataSnapshotCommandList = list_concat(metadataSnapshotCommandList,
|
metadataSnapshotCommandList = list_concat(metadataSnapshotCommandList,
|
||||||
colocationGroupSyncCommandList);
|
colocationGroupSyncCommandList);
|
||||||
|
|
||||||
/* As the last step, propagate the pg_dist_object entities */
|
|
||||||
Assert(ShouldPropagate());
|
|
||||||
List *distributedObjectSyncCommandList = DistributedObjectMetadataSyncCommandList();
|
List *distributedObjectSyncCommandList = DistributedObjectMetadataSyncCommandList();
|
||||||
metadataSnapshotCommandList = list_concat(metadataSnapshotCommandList,
|
metadataSnapshotCommandList = list_concat(metadataSnapshotCommandList,
|
||||||
distributedObjectSyncCommandList);
|
distributedObjectSyncCommandList);
|
||||||
|
@ -924,8 +922,6 @@ SyncPgDistTableMetadataToNodeList(List *nodeList)
|
||||||
/* send commands to new workers, the current user should be a superuser */
|
/* send commands to new workers, the current user should be a superuser */
|
||||||
Assert(superuser());
|
Assert(superuser());
|
||||||
|
|
||||||
List *syncPgDistMetadataCommandList = PgDistTableMetadataSyncCommandList();
|
|
||||||
|
|
||||||
List *nodesWithMetadata = NIL;
|
List *nodesWithMetadata = NIL;
|
||||||
WorkerNode *workerNode = NULL;
|
WorkerNode *workerNode = NULL;
|
||||||
foreach_ptr(workerNode, nodeList)
|
foreach_ptr(workerNode, nodeList)
|
||||||
|
@ -936,7 +932,12 @@ SyncPgDistTableMetadataToNodeList(List *nodeList)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (nodesWithMetadata == NIL)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
List *syncPgDistMetadataCommandList = PgDistTableMetadataSyncCommandList();
|
||||||
SendMetadataCommandListToWorkerListInCoordinatedTransaction(
|
SendMetadataCommandListToWorkerListInCoordinatedTransaction(
|
||||||
nodesWithMetadata,
|
nodesWithMetadata,
|
||||||
CurrentUserName(),
|
CurrentUserName(),
|
||||||
|
|
Loading…
Reference in New Issue