roryqi opened a new pull request, #13327: URL: https://github.com/apache/gravitino/pull/13327
### What changes were proposed in this pull request? This PR checks the metadata object in the list-roles-by-object REST API before querying role bindings. For table objects, the existing metadata object check goes through `tableExists()`, which can load/import externally managed tables into the entity store before role relations are queried. ### Why are the changes needed? The roles API currently queries role bindings directly through the entity-store relation path. For externally managed tables, such as JDBC tables, the table may exist in the underlying catalog but not yet have a local `table_meta` row until it is loaded. As a result, listing roles for an existing table can return `NoSuchMetadataObjectException` before the table is loaded, then return `200` after loading the same table. Fix: #13326 ### Does this PR introduce _any_ user-facing change? Yes. Listing roles for an existing metadata object now checks/resolves the object first. For externally managed tables that can be loaded from the catalog, this avoids returning a misleading 404 before the table has been imported into the entity store. ### How was this patch tested? Added a REST test covering table-object role listing and verifying that the table object is checked before roles are listed. Ran: `./gradlew spotlessApply` `./gradlew :server:test --tests org.apache.gravitino.server.web.rest.TestMetadataObjectRoleOperations -PskipITs -PskipDockerTests=false` -- 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]
