Release diff: master → previous_release - #17
Open
Th0rgal wants to merge 1 commit into
Open
Conversation
The cleanup task deleted all expired batch_index rows in a single statement. With a backlog (first enable, or downtime) that becomes one giant transaction cascading millions of module_dispatches rows. Delete in 10k chunks instead, and add an index on received_at so the expiry scan doesn't seq-scan the table.
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_35f6ffcb-b2f8-4dba-a661-8a853990d965) |
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.
Automated PR. The 'previous_release' branch is force-updated on every push to master to point at the commit before the push, so this PR always represents the current release diff.
Note
Medium Risk
Changes production data retention behavior under backlog conditions; chunked deletes are safer but cleanup may take longer and still cascade per chunk.
Overview
Batch index TTL cleanup no longer runs as one
DELETE ... WHERE received_at < $1. It now deletes up to 10,000 rows per iteration (oldestreceived_atfirst) until the backlog is cleared, so a large catch-up after first enable or downtime does not hold one long transaction onbatch_indexor trigger a massive ON DELETE CASCADE onmodule_dispatches.Schema adds
idx_batch_index_received_atonbatch_index (received_at)for that cleanup path, documented as used byobject_store_cleanup.rs.Reviewed by Cursor Bugbot for commit 4ebf288. Bugbot is set up for automated code reviews on this repo. Configure here.