Hi all,

While working on issue #6194 <https://github.com/apache/polaris/issues/6194>,
I noticed that JDBC and DynamoDB handle createEntitiesIfNotExist
differently when only some of the requested entities already exist.

Suppose A and B already exist with the requested IDs, C is new, and we
call createEntitiesIfNotExist([A,
B, C]).

   - *JDBC* succeeds, reuses A and B, and creates C in one transaction.
   This matches the current Javadoc and the shared test
   testCreateEntitiesAlreadyExisting. Javadoc
   
<https://github.com/apache/polaris/blob/main/polaris-core/src/main/java/org/apache/polaris/core/persistence/PolarisMetaStoreManager.java#L261-L278>
   - *DynamoDB* returns ENTITY_ALREADY_EXISTS and leaves C absent. DynamoDB
   PR #6144 <https://github.com/apache/polaris/pull/6144>

Which behavior should all persistence backends implement? Should the call
succeed by reusing entities with matching IDs and atomically creating the
missing ones, or should it return a conflict and create nothing when only
some of the requested IDs already exist?

Thanks,
Serhii

Reply via email to