Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR implements the ability to pause scheduled backups when a cluster is hibernated by the scale-to-zero sidecar, preventing backup errors on inactive clusters.
- Adds RBAC permissions for
scheduledbackupsresources - Implements scheduled backup management functionality in the sidecar
- Updates documentation to reflect the new backup pause behavior
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| manifest.yaml | Adds scheduledbackups to RBAC resources |
| manifest-dev.yaml | Adds scheduledbackups to RBAC resources |
| kubernetes/rbac.yaml | Updates RBAC to include scheduledbackups with required verbs |
| internal/sidecar/sidecar.go | Registers ScheduledBackup types in the runtime scheme |
| internal/sidecar/scale_to_zero_test.go | Adds comprehensive test coverage for scheduled backup scenarios |
| internal/sidecar/scale_to_zero.go | Implements core backup pause logic and cluster client interface |
| internal/sidecar/helper_test.go | Adds mock methods for scheduled backup operations |
| internal/sidecar/cluster_client.go | Implements scheduled backup client operations |
| doc/examples/cluster-example.yaml | Adds example ScheduledBackup resource |
| doc/development.md | Documents new scheduled backup management features |
| README.md | Updates documentation with backup management information |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
Not sure where to add this comment, so adding it here:there is a corner case where we may still have issues: if we try to hibernate a cluster while a full backup that the scheduledbackup triggered is going on. I think the easiest would be to not hibernate until the backup completes. However, it would be complicated to expose this to the customer as of right now, since we are not exposing backups to them yet. Alternatively, we could hibernate and let the backup fail, but that would potentially give us some unusable files in S3. We need to probably test a bit to see exactly what happens and what would be more straightforward for us. But for now, this is a big improvement already. |
|
🧹 PR Resources Cleaned Up Since this PR has been merged, the following test resources have been automatically deleted:
Thanks for testing! 🎉 |
This PR updates the scale to zero sidecar behaviour to suspend the cluster scheduled backups if any after the cluster is successfully hibernated to prevent errors.
https://cloudnative-pg.io/documentation/1.26/backup/#pause-scheduled-backups