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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to