Skip to content

[Console] Batch delete expired application backups in cleanup task#4391

Closed
shangeyao wants to merge 1 commit into
apache:devfrom
shangeyao:fix/backup-clean-batch-delete
Closed

[Console] Batch delete expired application backups in cleanup task#4391
shangeyao wants to merge 1 commit into
apache:devfrom
shangeyao:fix/backup-clean-batch-delete

Conversation

@shangeyao

Copy link
Copy Markdown
Contributor

Summary

  • Load all application backups in one query ordered by create time
  • Group by app id in memory and collect ids beyond the retention limit
  • Delete expired backups with a single removeByIds call

Fixes #4390

Test plan

  • Seed more than max-backup-num backups for an app and run cleanup
  • Verify only oldest extras are removed and latest N are kept

AI Disclosure

  • Model: Claude Opus 4.6
  • Platform/Tool: Cursor
  • Human Oversight: partially reviewed
  • Prompt Summary: Optimize backup cleanup task from dev branch scan

Made with Cursor

Replace per-app N+1 cleanup queries with a single load and batch
removeByIds to reduce database round trips.

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

Copy link
Copy Markdown
Contributor Author

Closing this PR because the StreamPark Console frontend is about to undergo a major refactor. These console-side changes would likely conflict with or require rework after the refactor. Will revisit relevant improvements once the new frontend architecture is in place.

@shangeyao shangeyao closed this Jun 30, 2026
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Console] Batch delete expired application backups in cleanup task

1 participant