LuciferYang opened a new issue, #13224:
URL: https://github.com/apache/gravitino/issues/13224

   **Version**
   main branch
   
   **Describe what's wrong**
   The 5-arg default `ModelCatalog.registerModel` registers the model and then 
links version 0. If `linkModelVersion` fails (e.g. 
`ModelVersionAliasesAlreadyExistException`), an orphan model with zero versions 
is left behind, and a retry of the registration fails with 
`ModelAlreadyExistsException`.
   
   **Error message and/or stacktrace**
   The original linking exception (e.g. 
`ModelVersionAliasesAlreadyExistException`) escapes; a subsequent retry of the 
registration then fails with `ModelAlreadyExistsException`.
   
   **How to reproduce**
   Call the default `registerModel(...)` where `linkModelVersion` fails (for 
example, a colliding version alias); the model is created but has zero 
versions, and re-running `registerModel` throws `ModelAlreadyExistsException`.
   
   **Additional context**
   The default should not leave a partially-constructed model behind on a 
linking failure. Found during a code audit of the `api` module.
   


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