-
Notifications
You must be signed in to change notification settings - Fork 17
Delete rolled-up daily archives from database and S3 #141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #141 +/- ##
=======================================
Coverage 58.03% 58.03%
=======================================
Files 7 7
Lines 908 908
=======================================
Hits 527 527
Misses 276 276
Partials 105 105 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: rowanseymour <[email protected]>
…r handling Co-authored-by: rowanseymour <[email protected]>
Co-authored-by: rowanseymour <[email protected]>
|
@copilot needs to delete any uploaded files from S3 for the archive rows being deleted. If Location is set then it has the bucket:key of the uploaded file. |
Co-authored-by: rowanseymour <[email protected]>
Co-authored-by: rowanseymour <[email protected]>
Added S3 file deletion in commit 0b83789. The function now:
S3 deletion errors are logged but don't block the database cleanup to ensure consistency. |
|
Repalced by #143 |
Daily archive records that have been rolled up into monthlies and had their source data deleted serve no purpose. They accumulate in the
archives_archivetable indefinitely, and their S3 files consume storage space.Implementation
DeleteRolledUpDailyArchives()to purge daily archives whererollup_id IS NOT NULL AND deleted_on IS NOT NULLArchiveOrg()after source record deletion completesDeleteS3File()helper function ins3.gofor S3 object deletionExample
The function identifies and removes daily archive metadata records and their S3 files while preserving the monthly rollups that contain the actual archived data. S3 deletion errors are logged but don't block database cleanup to ensure consistency.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.