iprithv commented on code in PR #5094:
URL: https://github.com/apache/polaris/pull/5094#discussion_r3634144123


##########
persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/JdbcBasePersistenceImpl.java:
##########
@@ -205,10 +203,14 @@ private void persistEntity(
           // 1. PRIMARY KEY violated
           // 2. UNIQUE CONSTRAINT on (realm_id, catalog_id, parent_id, 
type_code, name) violated
           // With SERIALIZABLE isolation, the conflicting entity may _not_ be 
visible and
-          // existingEntity can be null, which would cause an NPE in
-          // EntityAlreadyExistsException.message().
-          throw new EntityAlreadyExistsException(
-              existingEntity != null ? existingEntity : entity, e);
+          // existingEntity can be null. We cannot distinguish a same-id 
idempotent retry from a
+          // genuine name collision in that case, so we must report a 
concurrency conflict rather
+          // than fabricate the entity we were trying to create.
+          if (existingEntity != null) {

Review Comment:
   actually yes, conflict resolution is still approximate. we're essentially 
saying "something with this name already exists" rather than proving it's the 
exact conflicting row....after this gets in, we no longer fabricate the new 
entity as a successful create when the real conflict is invisible :)



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