Uh oh!
There was an error while loading. Please reload this page.
fix(webapp): stop slow database cleanup on project deletion - #4191
Conversation
Deleting a project triggered an unbounded database cleanup that scanned the project's entire run history, so deleting a project with many runs could be very slow. Project deletion is a soft delete again: run data is retained and the deletion completes quickly. The cascade-cleanup service had no other callers, so it and its test are removed.
WalkthroughProject deletion no longer performs a hard-delete cascade cleanup of run-ops data across run-ops databases. The 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Summary
Deleting a project triggered an unbounded database cleanup that scanned the project's entire run history, so deleting a project with many runs could be very slow. Project deletion is a soft delete again: run data is retained and the deletion completes quickly.
Fix
Project deletion ran a cascade hard-delete whose
BulkActionItemstep filtered through a relation toTaskRunscoped byprojectId. Prisma compiles that to anEXISTS-join over the project's entireTaskRunset (a large, hot table with noprojectIdindex), and it ran on every project deletion unconditionally.Removing the cascade-cleanup call restores the prior soft-delete behaviour: queues are removed, the project is marked deleted, and run data is retained. The cascade-cleanup service (added in #4117) had no other callers, so it and its test are deleted.