You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Handle a lost destination-name race in AtomicOperationMetaStoreManager.renameEntity() #5985
During the review of #5892, @flyrain pointed out that a rename can lose a race for its destination name, and that the failure is not handled. This was agreed to be fixed in a follow-up, for both the JDBC and DynamoDB (atomic) backends.
The problem
AtomicOperationMetaStoreManager.renameEntity() checks that the destination name is free, then calls persistEntityAfterChange(...). If another writer claims that name between the check and the write, the write fails on the name constraint. renameEntity() only catches RetryOnConcurrencyException, so the failure escapes as an unhandled error instead of an ENTITY_ALREADY_EXISTS result.
JDBC: the update path in JdbcBasePersistenceImpl.writeEntity() does not check for a uniqueness violation the way the create path does, so the constraint error is wrapped by wrapEntityWriteFailure(...) into a generic RuntimeException.
A create in the same situation already returns ENTITY_ALREADY_EXISTS (persistNewEntity catches EntityAlreadyExistsException), so rename is the odd one out.
Proposed fix
In AtomicOperationMetaStoreManager.renameEntity(), map EntityAlreadyExistsException to ENTITY_ALREADY_EXISTS, along the lines of:
In JdbcBasePersistenceImpl.writeEntity(), translate a uniqueness violation on the update path into EntityAlreadyExistsException, matching the create path.
Acceptance Criteria
A rename whose destination name is claimed concurrently returns ENTITY_ALREADY_EXISTS on both JDBC and DynamoDB, instead of an unhandled exception.
A test covers this race at the metastore-manager level.
Thanks for filing this issue, @ZephyrYWZhou . I think the fix option 1 would be preferable, as it avoid coupling Iceberg exception to the persistence layer.
Activity
flyrain commentedon Nov 5, 2026
Thanks for filing this issue, @ZephyrYWZhou . I think the fix option 1 would be preferable, as it avoid coupling Iceberg exception to the persistence layer.
Core: Report a rename that loses the race for its name as ENTITY_ALRE…