jarredhj0214 opened a new pull request, #15134:
URL: https://github.com/apache/gravitino/pull/15134

   ### What changes were proposed in this pull request?
   
   Add an ID lookup operation to EntityStore with a compatible full-read 
default. For relational tables, reuse a cached entity ID when available and 
otherwise read table metadata without its column snapshot. Route authorization 
table ID resolution through this operation.
   
   ### Why are the changes needed?
   
   When role policies are loaded on a metadata-ID cache miss, authorization 
resolves each securable table to an ID. The current lookup loads a complete 
TableEntity, including its column snapshot, only to return its ID. Roles 
containing many table grants can therefore load large amounts of unrelated 
column metadata.
   
   The optimized path preserves identifier normalization and missing-entity 
behavior. It does not cache partial entities or add another name-to-ID cache.
   
   Fixes #15133
   
   ### Does this PR introduce _any_ user-facing change?
   
   No REST API, authorization policy, or configuration change. EntityStore 
gains a default SPI method so existing store implementations remain compatible.
   
   ### How was this patch tested?
   
   Unit tests cover metadata-only mapper selection with caching enabled and 
disabled, warm and cold entity caches, request/shared authorization caches and 
invalidation, missing tables, storage errors, and the default store fallback. 
Relational backend tests cover ID resolution, subsequent full column reads, and 
deletion.
   
   277 tests passed (43 core storage/H2 tests and 234 server-common 
authorization tests), with no skipped tests in the selected suites. 
Docker-backed MySQL/PostgreSQL tests were not run.
   
   ```bash
   ./gradlew :core:test --tests '*TestRelationalEntityStore' --tests 
'*TestTableIdLookup' --tests '*TestTableMetaService' :server-common:test 
--tests '*TestMetadataIdConverter' --tests '*TestJcasbin*' -PskipITs 
-PskipDockerTests=true
   ```
   
   The changed Java sources were formatted with the module Spotless tasks; the 
build's Spotless checks and `git diff --check` passed.
   


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