fix(backup): set pending phase when backup is waiting to be processed#9364
Merged
fix(backup): set pending phase when backup is waiting to be processed#9364
Conversation
Member
Author
|
/test |
Contributor
|
@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/19896446945 |
36d8539 to
0d0a9d9
Compare
Contributor
|
I tested it with the in core barman-cloud support and with the plugin and the patch works beautifully. |
leonardoce
approved these changes
Dec 16, 2025
0d0a9d9 to
0f4d67c
Compare
When a backup is created but cannot be immediately processed (e.g., cluster not found, another backup is running, or target pod is not ready), the backup's phase should be set to "pending" to indicate its state to users. Previously, the backup phase could remain empty in these scenarios, which was misleading as users couldn't distinguish between a backup that hadn't started processing and one that was actively waiting. This change: - Adds a SetAsPending() method to BackupStatus for consistency with other SetAs* methods (SetAsStarted, SetAsCompleted, SetAsFailed) - Updates getCluster() to set pending when the target cluster is not found - Updates waitIfOtherBackupsRunning() to set pending when another backup for the same cluster is already running or waiting - Ensures startBackupManagedByInstance() and reconcileSnapshotBackup() use the new SetAsPending() method instead of direct phase assignment Signed-off-by: Armando Ruocco <[email protected]>
0f4d67c to
91a8dca
Compare
mnencia
approved these changes
Dec 17, 2025
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.
When a backup is created but cannot be immediately processed (e.g., cluster not found, another backup is running, or target pod is not ready), the backup's phase should be set to "pending" to indicate its state to users.
Previously, the backup phase could remain empty in these scenarios, which was misleading as users couldn't distinguish between a backup that hadn't started processing and one that was actively waiting.
This change: