nastra commented on code in PR #7880:
URL: https://github.com/apache/iceberg/pull/7880#discussion_r1337651860


##########
core/src/main/java/org/apache/iceberg/inmemory/InMemoryCatalog.java:
##########
@@ -143,27 +145,29 @@ public List<TableIdentifier> listTables(Namespace 
namespace) {
   }
 
   @Override
-  public synchronized void renameTable(TableIdentifier from, TableIdentifier 
to) {
+  public void renameTable(TableIdentifier from, TableIdentifier to) {
     if (from.equals(to)) {
       return;
     }
 
-    if (!namespaceExists(to.namespace())) {
-      throw new NoSuchNamespaceException(
-          "Cannot rename %s to %s. Namespace does not exist: %s", from, to, 
to.namespace());
-    }
+    synchronized (this) {
+      if (!namespaceExists(to.namespace())) {

Review Comment:
   I think we want to include the namespace existence check inside the sync 
block, as otherwise it could be possible that the namespace is concurrently 
dropped



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to