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

   ## What changes were proposed in this pull request?
   
   - Adds `updated_at BIGINT NOT NULL DEFAULT 0` to `role_meta`, `user_meta`, 
`group_meta`, `owner_meta` tables for version-validated strong consistency
   - Creates `entity_change_log` table for HA cross-node targeted invalidation 
of name→id cache
   - Adds covering indexes for auth read predicates on the above tables
   - Adds mapper methods:
     - `touchUpdatedAt` / `batchGetUpdatedAt` on `RoleMetaMapper`
     - `touchUpdatedAt` / `getUserInfo` on `UserMetaMapper`
     - `touchUpdatedAt` / `getGroupInfoByUserId` on `GroupMetaMapper`
     - `selectOwnerByMetadataObjectId` / `selectChangedOwners` on 
`OwnerMetaMapper`
   - Creates `EntityChangeLogMapper` for entity structural change tracking 
(insert/select/prune)
   - Adds result record types in `po/auth`: `UserAuthInfo`, `GroupAuthInfo`, 
`OwnerInfo`, `RoleUpdatedAt`, `ChangedOwnerInfo`, `EntityChangeRecord`
   - Provides MySQL upgrade script `upgrade-1.2.0-to-1.3.0-mysql.sql`
   
   Part of the Gravitino auth cache improvement design: Phase 1.2 + Phase 2 DB 
schema work.
   
   ## Why are the changes needed?
   
   The current JcasbinAuthorizer reloads all role policies on every request 
when the cache misses. The `updated_at` version sentinels enable 
strong-consistency version checks so that only stale entries are reloaded, and 
the `entity_change_log` table enables targeted cross-node cache invalidation in 
HA deployments without full cache flushes.
   
   ## Does this PR introduce _any_ user-facing changes?
   
   No. All changes are internal DB schema and mapper additions; no public API 
changes.
   
   ## How was this patch tested?
   
   - [ ] `./gradlew :core:test -PskipITs`
   - [ ] Manual: apply upgrade SQL against a 1.2.0 schema, verify columns and 
indexes exist
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


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