fix(kilobase): fix hourly backup bug and add WAL retention cleanup#7757
Merged
fix(kilobase): fix hourly backup bug and add WAL retention cleanup#7757
Conversation
The ScheduledBackup cron '0 2 * * *' was a 5-field format being parsed as 6-field by CNPG (sec=0 min=2 hour=* → every hour at :02). Fix to '0 0 2 * * *' for daily at 2 AM UTC. This was causing 24x more base backups per day and inflating S3 costs. Also adds instanceSidecarConfiguration with retentionPolicyIntervalSeconds to clean up WAL files beyond the retention window. Increased retention from 3d to 7d for safety.
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
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.
Summary
0 2 * * *was parsed assec=0 min=2 hour=*(hourly at :02). Fixed to0 0 2 * * *(daily at 2:00 AM UTC).instanceSidecarConfiguration.retentionPolicyIntervalSeconds: 1800runs barman cleanup every 30 minutes, removing WAL files and base backups beyond the retention window.Root Cause of S3 Cost Increase
The 5-field cron
0 2 * * *was creating 24 base backups per day instead of 1. Combined with no WAL cleanup, S3 storage was growing unbounded. This has been running since the ScheduledBackup was created (~101 days ago).Post-merge Manual Steps
After ArgoCD syncs, clean up the 29 failed backup CRDs:
The WAL cleanup sidecar will automatically start purging old WAL files from S3 within 30 minutes of deployment.
Test plan
nextScheduleTime~24h from now (not ~1h)🤖 Generated with Claude Code