yuqi1129 opened a new pull request, #13699:
URL: https://github.com/apache/gravitino/pull/13699
### What changes were proposed in this pull request?
Normalize names by catalog capability before constructing JCasbin's shared
and per-request metadata ID cache keys, using the same normalization
implementation as ID resolution. Load IDs from the canonical name used by the
key. Preserve case-sensitive names, semantic model leaves, and types without a
catalog scope; normalize column schema/table parents using their own scopes.
### Why are the changes needed?
For case-insensitive catalogs, a request such as `cat.DB.TBL` previously
cached an ID under its raw spelling. Local hooks and peer change-log replay
evicted only `cat.db.tbl`, leaving the alias to authorize against the old
object's ID after name reuse.
Fix: #13694
### Does this PR introduce _any_ user-facing change?
Case-variant requests share one cache key, so normalized invalidation also
removes their stale IDs. No configuration or REST API changes. Catalog
capability lookup also occurs on cache hits.
### How was this patch tested?
- 105 targeted tests passed: the new normalization suite (33), JCasbin
authorizer (65), lookups (4), and metadata ID converter (3), with zero
failures/errors/skips.
- Cover local table drop/rename and schema drop hooks, peer change-log
replay, name reuse, both cache tiers, case-sensitive catalogs, missing
catalogs, semantic model leaf preservation, and mixed column-parent scopes.
Type coverage derives from the production scope mapping.
- All seven mapped types are covered for normalization. ID-load tests cover
the six types satisfying `EntityStore.get`'s `HasIdentifier` contract.
Standalone COLUMN ID loading remains unsupported by the existing store; column
canonicalization and descendant-key eviction are tested without inventing a
production-incompatible entity.
- Server-common Spotless and Javadoc checks passed. Only relevant tests were
run; no full core/module or Docker suite was run.
- Independent fresh-context v7 review of commit
`e246a9fbc01f1aa20e42118aaa24dbf699326d6d` found no Blocker or Important
issues. An isolated baseline passed all 33 new cases. All five non-equivalent
mutations were caught: raw cache keys, raw-name loading, omitted column-parent
normalization, folded semantic-model leaves, and disabled peer invalidation
(zero survivors).
```sh
SKIP_DOCKER_TESTS=true ./gradlew :server-common:test \
--tests '*TestJcasbinMetadataIdCacheNormalization' \
--tests '*TestJcasbinAuthorizationLookups' \
--tests '*TestMetadataIdConverter' \
--tests '*TestJcasbinAuthorizer' \
-PskipITs -PskipDockerTests=true -PskipWeb=true
```
--
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]