Skip to content

Commit a781582

Browse files
switch order (#13)
1 parent 47e98f2 commit a781582

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

polaris-synchronizer/api/src/main/java/org/apache/polaris/tools/sync/polaris/PolarisSynchronizer.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -630,8 +630,6 @@ public void syncCatalogs() {
630630
}
631631

632632
for (Catalog catalog : catalogSyncPlan.entitiesToSyncChildren()) {
633-
syncCatalogRoles(catalog.getName());
634-
635633
IcebergCatalogService sourceIcebergCatalogService;
636634

637635
try {
@@ -666,6 +664,11 @@ public void syncCatalogs() {
666664

667665
syncNamespaces(
668666
catalog.getName(), Namespace.empty(), sourceIcebergCatalogService, targetIcebergCatalogService);
667+
668+
// NOTE: Grants are synced on a per catalog role basis, so we need to ensure that catalog roles
669+
// are only synced AFTER Iceberg catalog entities, because they may depend on the Iceberg catalog
670+
// entities already existing
671+
syncCatalogRoles(catalog.getName());
669672
}
670673
}
671674

0 commit comments

Comments
 (0)