damccorm commented on code in PR #41069:
URL: https://github.com/apache/beam/pull/41069#discussion_r4512602360


##########
sdks/java/io/iceberg/src/main/java/org/apache/beam/sdk/io/iceberg/RecordWriterManager.java:
##########
@@ -345,12 +346,14 @@ private Table loadOrCreateTable(IcebergDestination 
destination, Schema dataSchem
     // Create namespace if it does not exist yet
     if (!namespace.isEmpty() && catalog instanceof SupportsNamespaces) {
       SupportsNamespaces supportsNamespaces = (SupportsNamespaces) catalog;
-      if (!supportsNamespaces.namespaceExists(namespace)) {
-        try {
-          supportsNamespaces.createNamespace(namespace);
-          LOG.info("Created new namespace '{}'.", namespace);
-        } catch (AlreadyExistsException ignored) {
-          // race condition: another worker already created this namespace
+      synchronized (NAMESPACE_LOCK) {

Review Comment:
   Will this have significant performance implications?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to