feat(backup): prevent backups on hibernated clusters#8870
Merged
leonardoce merged 2 commits intomainfrom Oct 21, 2025
Merged
Conversation
Contributor
|
❗ By default, the pull request is configured to backport to all release branches.
|
Member
Author
|
/test limit=local |
Contributor
|
@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/18560926214 |
mnencia
approved these changes
Oct 20, 2025
Add hibernation validation in BackupReconciler.checkPrerequisites to fail backups when the target cluster has hibernation enabled. The validation follows the existing pattern where prerequisite checks are performed in the backup controller after the Backup resource is created. When hibernation is detected, the backup is marked as failed with reason "ClusterIsHibernated" and a warning event is recorded on the Backup resource itself. This approach is consistent with how other prerequisite failures are handled (e.g., missing backup configuration, missing plugins, no VolumeSnapshot support), allowing the error to be visible directly on the Backup object regardless of how it was created (manually, via ScheduledBackup, or other means). Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
leonardoce
approved these changes
Oct 21, 2025
Contributor
|
/ok-to-merge |
Contributor
|
This should be tracked as a "change" in 1.28. Just curious, why did you guys decide not to backport this? |
Contributor
Because the patch was designed as a feature that clarifies the reason of an error condition. |
gbartolini
pushed a commit
that referenced
this pull request
Oct 22, 2025
Add hibernation validation in `BackupReconciler.checkPrerequisites` to fail backups when the target cluster has hibernation enabled. The validation follows the existing pattern where prerequisite checks are performed in the backup controller after the Backup resource is created. When hibernation is detected, the backup is marked as failed with reason `ClusterIsHibernated` and a warning event is recorded on the Backup resource itself. This approach is consistent with how other prerequisite failures are handled (e.g., missing backup configuration, missing plugins, no `VolumeSnapshot` support), allowing the error to be visible directly on the Backup object regardless of how it was created (manually, via `ScheduledBackup`, or other means). Related #8508 Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com> Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com> Co-authored-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com> (cherry picked from commit fb9e1f9)
Contributor
|
@armru what do you think? |
mnencia
pushed a commit
that referenced
this pull request
Oct 22, 2025
Add hibernation validation in `BackupReconciler.checkPrerequisites` to fail backups when the target cluster has hibernation enabled. The validation follows the existing pattern where prerequisite checks are performed in the backup controller after the Backup resource is created. When hibernation is detected, the backup is marked as failed with reason `ClusterIsHibernated` and a warning event is recorded on the Backup resource itself. This approach is consistent with how other prerequisite failures are handled (e.g., missing backup configuration, missing plugins, no `VolumeSnapshot` support), allowing the error to be visible directly on the Backup object regardless of how it was created (manually, via `ScheduledBackup`, or other means). Related #8508 Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com> Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com> Co-authored-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com> (cherry picked from commit fb9e1f9)
mnencia
pushed a commit
that referenced
this pull request
Oct 22, 2025
Add hibernation validation in `BackupReconciler.checkPrerequisites` to fail backups when the target cluster has hibernation enabled. The validation follows the existing pattern where prerequisite checks are performed in the backup controller after the Backup resource is created. When hibernation is detected, the backup is marked as failed with reason `ClusterIsHibernated` and a warning event is recorded on the Backup resource itself. This approach is consistent with how other prerequisite failures are handled (e.g., missing backup configuration, missing plugins, no `VolumeSnapshot` support), allowing the error to be visible directly on the Backup object regardless of how it was created (manually, via `ScheduledBackup`, or other means). Related #8508 Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com> Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com> Co-authored-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com> (cherry picked from commit fb9e1f9)
4 tasks
THE-BRAHMA
pushed a commit
to THE-BRAHMA/cloudnative-pg
that referenced
this pull request
Oct 30, 2025
…8870) Add hibernation validation in `BackupReconciler.checkPrerequisites` to fail backups when the target cluster has hibernation enabled. The validation follows the existing pattern where prerequisite checks are performed in the backup controller after the Backup resource is created. When hibernation is detected, the backup is marked as failed with reason `ClusterIsHibernated` and a warning event is recorded on the Backup resource itself. This approach is consistent with how other prerequisite failures are handled (e.g., missing backup configuration, missing plugins, no `VolumeSnapshot` support), allowing the error to be visible directly on the Backup object regardless of how it was created (manually, via `ScheduledBackup`, or other means). Related cloudnative-pg#8508 Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com> Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com> Co-authored-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com> Signed-off-by: theBrahma <office.utpal.brahma@gmail.com>
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.
Add hibernation validation in BackupReconciler.checkPrerequisites to fail backups when the target cluster has hibernation enabled.
The validation follows the existing pattern where prerequisite checks are performed in the backup controller after the Backup resource is created. When hibernation is detected, the backup is marked as failed with reason "ClusterIsHibernated" and a warning event is recorded on the Backup resource itself.
This approach is consistent with how other prerequisite failures are handled (e.g., missing backup configuration, missing plugins, no VolumeSnapshot support), allowing the error to be visible directly on the Backup object regardless of how it was created (manually, via ScheduledBackup, or other means).
Related #8508