Skip to content

fix(db): add small batch budgets for reclaim cleanups#2735

Draft
riderx wants to merge 1 commit into
mainfrom
fix/cleanup-batch-budget
Draft

fix(db): add small batch budgets for reclaim cleanups#2735
riderx wants to merge 1 commit into
mainfrom
fix/cleanup-batch-budget

Conversation

@riderx

@riderx riderx commented Jul 23, 2026

Copy link
Copy Markdown
Member

Summary (AI generated)

  • Add optional (max_batches, batch_size) args to queue/audit/manifest cleanup functions (defaults keep cron behavior)
  • Split dashboard reclaim into one-statement step scripts with tiny budgets
  • Test that a small budget only deletes part of the work

Motivation (AI generated)

Capgo-EU SQL Editor times out on full reclaim calls. Ops needs to clean part-by-part by re-running small statements.

Business Impact (AI generated)

Unblocks Capgo-EU bloat reclaim without upgrading compute or needing long dashboard timeouts.

Test Plan (AI generated)

  • bunx vitest run tests/cleanup_swap_memory.test.ts
  • Paste migration on Capgo-EU, then repeatedly run SELECT public.cleanup_queue_messages(1, 500); until notice is 0

Generated with AI

Made with Cursor

Review in cubic

Let SQL Editor reclaim iteratively with tiny per-call limits instead of
timing out on one large cleanup_queue_messages/audit/manifest run.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2c42742d-f976-49be-a707-4745c9cacb41

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@codspeed-hq

codspeed-hq Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 43 untouched benchmarks
⏩ 2 skipped benchmarks1


Comparing fix/cleanup-batch-budget (b84a60a) with main (e9b7256)

Open in CodSpeed

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@sonarqubecloud

Copy link
Copy Markdown

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.

1 participant