keepConcentration commented on issue #8293:
URL: https://github.com/apache/gravitino/issues/8293#issuecomment-3237603331

   Hi,
   
   I found that `setOwner` is invoked twice within 
`TestOwnerMetaService.testDeleteMetadataObject`.
   
   ```java
   OwnerMetaService.getInstance()
           .setOwner(model.nameIdentifier(), model.type(), 
user.nameIdentifier(), user.type());
   OwnerMetaService.getInstance()
           .setOwner(model.nameIdentifier(), model.type(), 
user.nameIdentifier(), user.type());
   ```
   
   This results in the creation of duplicate active rows with the combination 
`(owner_id, metadata_object_id, metadata_object_type, deleted_at=0)`. 
Subsequently, when 
`OwnerMetaBaseSQLProvider.softDeleteOwnerRelByMetadataObjectIdAndType()` is 
executed, these duplicate rows are updated with the same deleted_at value, 
which leads to a `JdbcSQLIntegrityConstraintViolationException`.
   
   As a short-term fix, this can be addressed by modifying 
`testDeleteMetadataObject` to call `setOwner(...)` only once.
   


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