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

   ### Version
   
   main branch
   
   ### Describe what's wrong
   
   `IcebergViewHookDispatcher#createView` creates the view in the backend, then 
imports it into
   Gravitino with `importView`, then sets the caller as owner. `importView` 
catches every exception and
   only logs a warning. When the import fails, the owner step runs on a view 
with no entity, and
   `OwnerManager#setOwner` throws `NotFoundException`.
   
   So:
   
   - **The client gets a misleading error.** A create that succeeded in the 
backend returns "not found",
     and a retry returns AlreadyExists.
   - **The view is left with no entity and no owner**, so its creator cannot 
use it under authorization.
   
   The table and namespace hooks already let the import failure propagate on 
purpose
   (`IcebergTableHookDispatcher#importTableAndSetOwner`: "Import is 
intentionally NOT wrapped in
   try-catch"). The existing test 
`testCreateViewHandlesImportFailureGracefully` passes only because its
   mocked owner dispatcher does not check that the entity exists.
   
   ### Error message and/or stacktrace
   
   ```
   NotFoundException: Metadata object <catalog>.<schema>.<view> or owner <user> 
is not found
   ```
   
   ### How to reproduce
   
   1. Run the Iceberg REST server in auxiliary mode with 
`gravitino.authorization.enable=true`.
   2. `POST /v1/{prefix}/namespaces/s1/views` with a request for which the 
Gravitino import fails after
      the backend commit, for example while the entity store is failing.
   
   Expected: the client sees the import error, as for `createTable`.
   Actual: the client sees "not found". The view exists in the backend with no 
entity and no owner.
   
   ### Additional context
   
   Proposed fix: let the import exception propagate on the create path, and 
keep the drop and rename
   reconcile best-effort as today.
   


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