You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "lasdf1234 (via GitHub)" <gi...@apache.org> on 2026/08/18 10:35:30 UTC

[PR] [#12486] fix(core): write-through user/group cache and drop unused externalId mutations [gravitino]

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

   ### What changes were proposed in this pull request?
   
   - `RelationalEntityStore.update` and `updateById` now write the updated entity back into the name-keyed cache (`cache.put`) instead of only invalidating. On rename, the old name key is dropped first.
   - Remove unused User/Group mutation-by-externalId APIs that have no REST, Java client, or SCIM callers:
     - `AccessControlDispatcher.removeUserByExternalId` / `removeGroupByExternalId`
     - storage `updateByExternalId` / `deleteByExternalId` and `UserMetaService.updateUserByExternalId`
   - Keep `getUserByExternalId` / `getGroupByExternalId`.
   - Keep `OperationType.REMOVE_*_BY_EXTERNAL_ID` so historical audit logs still parse.
   
   `put` already wrote through the cache; `delete` / `deleteById` already invalidate. Grant/revoke role updates go through `store.update`, so they pick up the same write-through.
   
   ### Why are the changes needed?
   
   After `alterUserById` / `alterGroupById` (for example SCIM PATCH `active=false`), name-based `getUser` / `getGroup` can keep serving the pre-update entity until cache TTL. GET-by-id is unaffected because it always hits the backend.
   
   The externalId update/delete APIs were never wired to REST or the Java client. SCIM looks up by `externalId` and mutates/deletes by Gravitino-assigned id.
   
   Fix: #12486
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. These dispatcher/storage methods are removed:
   
   - `removeUserByExternalId`
   - `removeGroupByExternalId`
   - `SupportsExternalIdOperations.updateByExternalId`
   - `SupportsExternalIdOperations.deleteByExternalId`
   
   They were not exposed on REST or the Java client. `getUserByExternalId` / `getGroupByExternalId` remain.
   
   ### How was this patch tested?
   
   ```
   ./gradlew :core:test \
     --tests org.apache.gravitino.storage.relational.service.TestUserMetaService \
     --tests org.apache.gravitino.authorization.TestAccessControlManager \
     --tests org.apache.gravitino.listener.api.event.TestUserEvent \
     --tests org.apache.gravitino.listener.api.event.TestGroupEvent \
     --tests org.apache.gravitino.storage.memory.TestMemoryEntityStore \
     -PskipITs
   ```
   
   Added cache write-through tests in `TestEntityStorageRelationCache` for user `updateById`, user `update`, and group `updateById`.
   
   Made with [Cursor](https://cursor.com)


-- 
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: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#12486] fix(core): version-validate user/group entity cache via updated_at [gravitino]

Posted by "lasdf1234 (via GitHub)" <gi...@apache.org>.
lasdf1234 closed pull request #12487: [#12486] fix(core): version-validate user/group entity cache via updated_at
URL: https://github.com/apache/gravitino/pull/12487


-- 
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: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#12486] fix(core): version-validate user/group entity cache via updated_at [gravitino]

Posted by "lasdf1234 (via GitHub)" <gi...@apache.org>.
lasdf1234 commented on PR #12487:
URL: https://github.com/apache/gravitino/pull/12487#issuecomment-5389942897

   This function is not needed. Close the issue.


-- 
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: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org