Skip to content

Clean up orphaned partition summaries when deleting summary views - #358

Open
zekey-huang wants to merge 1 commit into
redis:mainfrom
zekey-huang:fix/delete-orphaned-partition-summaries
Open

zekey-huang wants to merge 1 commit into
redis:mainfrom
zekey-huang:fix/delete-orphaned-partition-summaries

Conversation

@zekey-huang

@zekey-huang zekey-huang commented Aug 11, 2026 •

Copy link
Copy Markdown

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.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 06a7ba7. Configure here.

await redis.delete(key)

if cursor == 0:
break

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 06a7ba7. Configure here.

This branch has not been deployed

No deployments
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.

deleteSummaryView does not clean up computed partition summaries

1 participant