Skip to content

[v17] fix: use DeleteAllPrincipalAssignments to delete principal assignment from cache#61313

Merged
flyinghermit merged 3 commits intobranch/v17from
sshah/ic-cache
Nov 13, 2025
Merged

[v17] fix: use DeleteAllPrincipalAssignments to delete principal assignment from cache#61313
flyinghermit merged 3 commits intobranch/v17from
sshah/ic-cache

Conversation

@flyinghermit
Copy link
Copy Markdown
Contributor

@flyinghermit flyinghermit commented Nov 13, 2025

During first cache start, cache executer loops through each of the supported resource and builds up cache with the following tasks:

  • get the resource from backend
  • delete the resource from cache (pre-cleanup)
  • upsert resource items in cache

The cache identityCenterPrincipalAssignmentExecutor.deleteAll method was erroneously using DeleteAllIdentityCenterAccounts instead of DeleteAllPrincipalAssignments method, deleting the all the account from the cache. The order of the execution is not in a linear order. Depending on whether principalAssignment executer runs before or after the account executer, the behaviour accounted for situation where accounts may persist or be emptied from the cache in a random fashion.

This issue only affects v17 branch.
The first bug was introduced here where DeleteAllIdentityCenterAccounts was used instead of DeleteAllAccountAssignments. This was fixed with this PR, which itself introduced this new bug using DeleteAllIdentityCenterAccounts instead of DeleteAllPrincipalAssignments.

changelog: Fixed an issue with the Identity Center resource cache that could cause the account resources to be deleted from the cache.

@flyinghermit flyinghermit changed the title fix: use DeleteAllPrincipalAssignments in cache identityCenterPrincipalAssignmentExecutor.deleteAll fix: use DeleteAllPrincipalAssignments to delete principal assignment from cache Nov 13, 2025
@flyinghermit flyinghermit marked this pull request as ready for review November 13, 2025 05:31
Comment thread lib/cache/identitycenter_test.go Outdated
Comment thread lib/cache/identitycenter_test.go Outdated
Comment thread lib/cache/identitycenter_test.go Outdated
Comment thread lib/cache/identitycenter_test.go Outdated
Comment thread lib/cache/identitycenter_test.go Outdated
Comment thread lib/cache/identitycenter_test.go Outdated
Comment thread lib/cache/identitycenter_test.go
@espadolini espadolini changed the title fix: use DeleteAllPrincipalAssignments to delete principal assignment from cache [v17] fix: use DeleteAllPrincipalAssignments to delete principal assignment from cache Nov 13, 2025
@flyinghermit flyinghermit added this pull request to the merge queue Nov 13, 2025
Merged via the queue into branch/v17 with commit 21f7fb1 Nov 13, 2025
38 checks passed
@flyinghermit flyinghermit deleted the sshah/ic-cache branch November 13, 2025 16:15
@aadc-dev aadc-dev mentioned this pull request Nov 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants