Conversation
…ng system on ownership rules
…dation-to-ownership-timestamp-versioning
cvxluo
approved these changes
Jan 20, 2026
Member
Author
|
bugbot run |
shashjar
commented
Jan 20, 2026
| data=data, | ||
| ) | ||
| record_group_history(group, GroupHistoryStatus.ASSIGNED, actor=acting_user) | ||
| GroupOwner.invalidate_assignee_exists_cache(group.id) |
Member
Author
There was a problem hiding this comment.
Adding a cache invalidation here (in the assign method) to expire stale value
cvxluo
reviewed
Jan 20, 2026
wedamija
approved these changes
Jan 20, 2026
dashed
pushed a commit
that referenced
this pull request
Jan 26, 2026
… timestamp versioning on ownership (#106479) Follow-up to #106108. Closes [ID-1238](https://linear.app/getsentry/issue/ID-1238/cache-for-assignee-existence-check-uses-expensive-fan-out-invalidation). This PR extends the O(1) timestamp-based cache invalidation pattern (introduced in the above PR for the issue owners debounce cache) to the assignee existence check cache. The `invalidate_assignee_exists_cache` method previously performed expensive fan-out O(n) cache invalidation. When CODEOWNERS or ownership rules changed, we would previously: 1. Query all groups in the project with recent events 2. Delete the assignee existence cache entry for each group individually (via batched `cache.delete_many`) **Before:** - Assignee existence cache stored a simple boolean - On ownership change: delete cache entries for ALL active groups in the project (O(n)) **After:** - Assignee existence cache stores `(value, timestamp)` tuple - On ownership change, set the project-wide `ownership_changed_at` timestamp - On cache read: - If cache is `None` --> query DB, cache result with timestamp - If cache is a tuple `(value, timestamp)`, compare against `ownership_changed_at` - If `ownership_changed_at` is `None` or `ownership_changed_at` < `cached_timestamp` --> use cached value - If `ownership_changed_at` >= `cached_timestamp` --> ownership rules changed, re-query DB - If cache is old format (boolean) --> backwards compatibility, use value directly ### Follow-Up Left TODO in the code: - Remove backwards compatibility logic for old boolean cache values 24 hrs after this PR is rolled out
JonasBa
pushed a commit
that referenced
this pull request
Jan 27, 2026
… timestamp versioning on ownership (#106479) Follow-up to #106108. Closes [ID-1238](https://linear.app/getsentry/issue/ID-1238/cache-for-assignee-existence-check-uses-expensive-fan-out-invalidation). This PR extends the O(1) timestamp-based cache invalidation pattern (introduced in the above PR for the issue owners debounce cache) to the assignee existence check cache. The `invalidate_assignee_exists_cache` method previously performed expensive fan-out O(n) cache invalidation. When CODEOWNERS or ownership rules changed, we would previously: 1. Query all groups in the project with recent events 2. Delete the assignee existence cache entry for each group individually (via batched `cache.delete_many`) **Before:** - Assignee existence cache stored a simple boolean - On ownership change: delete cache entries for ALL active groups in the project (O(n)) **After:** - Assignee existence cache stores `(value, timestamp)` tuple - On ownership change, set the project-wide `ownership_changed_at` timestamp - On cache read: - If cache is `None` --> query DB, cache result with timestamp - If cache is a tuple `(value, timestamp)`, compare against `ownership_changed_at` - If `ownership_changed_at` is `None` or `ownership_changed_at` < `cached_timestamp` --> use cached value - If `ownership_changed_at` >= `cached_timestamp` --> ownership rules changed, re-query DB - If cache is old format (boolean) --> backwards compatibility, use value directly ### Follow-Up Left TODO in the code: - Remove backwards compatibility logic for old boolean cache values 24 hrs after this PR is rolled out
shashjar
added a commit
that referenced
this pull request
Jan 28, 2026
…stence cache (#107022) Follow-up to #106479. Closes [ID-1238](https://linear.app/getsentry/issue/ID-1238/cache-for-assignee-existence-check-uses-expensive-fan-out-invalidation). It's been >24 hours since the PR above was deployed and the assignee existence cache values were migrated to the new format. We can therefore remove the backwards compatibility logic, since all cache values will now correctly be 2-tuples of `(assignee_exists, assignee_debounce_time)`.
priscilawebdev
pushed a commit
that referenced
this pull request
Feb 2, 2026
… timestamp versioning on ownership (#106479) Follow-up to #106108. Closes [ID-1238](https://linear.app/getsentry/issue/ID-1238/cache-for-assignee-existence-check-uses-expensive-fan-out-invalidation). This PR extends the O(1) timestamp-based cache invalidation pattern (introduced in the above PR for the issue owners debounce cache) to the assignee existence check cache. The `invalidate_assignee_exists_cache` method previously performed expensive fan-out O(n) cache invalidation. When CODEOWNERS or ownership rules changed, we would previously: 1. Query all groups in the project with recent events 2. Delete the assignee existence cache entry for each group individually (via batched `cache.delete_many`) **Before:** - Assignee existence cache stored a simple boolean - On ownership change: delete cache entries for ALL active groups in the project (O(n)) **After:** - Assignee existence cache stores `(value, timestamp)` tuple - On ownership change, set the project-wide `ownership_changed_at` timestamp - On cache read: - If cache is `None` --> query DB, cache result with timestamp - If cache is a tuple `(value, timestamp)`, compare against `ownership_changed_at` - If `ownership_changed_at` is `None` or `ownership_changed_at` < `cached_timestamp` --> use cached value - If `ownership_changed_at` >= `cached_timestamp` --> ownership rules changed, re-query DB - If cache is old format (boolean) --> backwards compatibility, use value directly ### Follow-Up Left TODO in the code: - Remove backwards compatibility logic for old boolean cache values 24 hrs after this PR is rolled out
priscilawebdev
pushed a commit
that referenced
this pull request
Feb 2, 2026
…stence cache (#107022) Follow-up to #106479. Closes [ID-1238](https://linear.app/getsentry/issue/ID-1238/cache-for-assignee-existence-check-uses-expensive-fan-out-invalidation). It's been >24 hours since the PR above was deployed and the assignee existence cache values were migrated to the new format. We can therefore remove the backwards compatibility logic, since all cache values will now correctly be 2-tuples of `(assignee_exists, assignee_debounce_time)`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #106108.
Closes ID-1238.
This PR extends the O(1) timestamp-based cache invalidation pattern (introduced in the above PR for the issue owners debounce cache) to the assignee existence check cache.
The
invalidate_assignee_exists_cachemethod previously performed expensive fan-out O(n) cache invalidation. When CODEOWNERS or ownership rules changed, we would previously:cache.delete_many)Before:
After:
(value, timestamp)tupleownership_changed_attimestampNone--> query DB, cache result with timestamp(value, timestamp), compare againstownership_changed_atownership_changed_atisNoneorownership_changed_at<cached_timestamp--> use cached valueownership_changed_at>=cached_timestamp--> ownership rules changed, re-query DBFollow-Up
Left TODO in the code: