Clean up orphaned partition summaries when deleting summary views - #358
Open
Zekward wants to merge 1 commit into
Open
Clean up orphaned partition summaries when deleting summary views#358Zekward wants to merge 1 commit into
Zekward wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 06a7ba7. Configure here.
| await redis.delete(key) | ||
|
|
||
| if cursor == 0: | ||
| break |
There was a problem hiding this comment.
Refresh recreates deleted summaries
Medium Severity
Deleting a view only cleans summary keys present during the SCAN. An in-flight refresh_summary_view that already loaded the view can keep calling save_partition_result afterward and recreate summary_view:{view_id}:summary:* keys with no config left, reintroducing the orphaned Redis data this change aims to remove. The race window is large because partition summarization can run for minutes.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 06a7ba7. Configure here.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.


What
When a SummaryView is deleted, also remove all associated computed partition
summaries (summary_view:{view_id}:summary:*) from Redis.
Why
Previously these keys were left behind as orphaned data. Over time or across
reset cycles, they accumulate and consume memory unnecessarily.
How
Use SCAN to iterate through all partition summary keys matching the view ID,
then DELETE each one. This follows the existing SCAN pattern used elsewhere
in the codebase.
Fixes #229
Note
Cursor Bugbot is generating a summary for commit 06a7ba7. Configure here.