Skip to content

[TEST]#11719

Draft
yuqi1129 wants to merge 1 commit into
apache:mainfrom
yuqi1129:me/fix-role-relation-cache-grant-11701
Draft

[TEST]#11719
yuqi1129 wants to merge 1 commit into
apache:mainfrom
yuqi1129:me/fix-role-relation-cache-grant-11701

Conversation

@yuqi1129

@yuqi1129 yuqi1129 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Invalidate derived relation cache entries after entity writes for role-related relationships stored inside entity fields:

  • Role securable objects invalidate object-side METADATA_OBJECT_ROLE_REL caches.
  • User role grants invalidate role-side ROLE_USER_REL caches.
  • Group role grants invalidate role-side ROLE_GROUP_REL caches.

Why are the changes needed?

When a new relation is added through an entity update, the reverse index may not contain a path from the updated entity to an already cached relation list on the other side. A later load/list can then return stale data until the relation cache entry expires.

Fix: #11701

Does this PR introduce any user-facing change?

No.

How was this patch tested?

  • ./gradlew :core:spotlessApply
  • git diff --check
  • ./gradlew :core:test --tests org.apache.gravitino.storage.TestEntityStorageRelationCache.testGrantPrivilegeInvalidatesMetadataObjectRoleRelCache --tests org.apache.gravitino.storage.TestEntityStorageRelationCache.testCreateRoleInvalidatesMetadataObjectRoleRelCache --tests org.apache.gravitino.storage.TestEntityStorageRelationCache.testGrantRoleToUserInvalidatesRoleUserRelCache --tests org.apache.gravitino.storage.TestEntityStorageRelationCache.testGrantRoleToGroupInvalidatesRoleGroupRelCache --tests org.apache.gravitino.storage.TestEntityStorageRelationCache.testCacheInvalidationOnNewRelationReverse -PskipITs -PskipDockerTests=false

@yuqi1129 yuqi1129 force-pushed the me/fix-role-relation-cache-grant-11701 branch from dc95bf1 to 48e8885 Compare June 17, 2026 12:50
@yuqi1129 yuqi1129 force-pushed the me/fix-role-relation-cache-grant-11701 branch from 48e8885 to 02fe77a Compare June 17, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug report] Newly granted role missing from listBindingRoleNames until relation cache TTL elapses

1 participant