Skip to content

Commit

Permalink
fix logic where we remove stalled backups
Browse files Browse the repository at this point in the history
  • Loading branch information
nhudson committed Sep 27, 2024
1 parent 219f0fe commit d3e0fbf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tembo-operator/src/cloudnativepg/hibernate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ pub async fn reconcile_cluster_hibernation(cdb: &CoreDB, ctx: &Arc<Context>) ->
name, hibernation_value
);
if cdb.spec.stop {
// Only remove stalled backups if the instance is stopped/paused
info!("Remove any stalled backups for paused instance {}", name);
removed_stalled_backups(cdb, ctx).await?;

info!("Fully reconciled stopped instance {}", name);
return Err(requeue_normal_with_jitter());
}
Expand All @@ -204,9 +208,6 @@ pub async fn reconcile_cluster_hibernation(cdb: &CoreDB, ctx: &Arc<Context>) ->
patch_cdb_status_merge(&coredbs, &name, patch_status).await?;

if cdb.spec.stop {
// Only remove stalled backups if the instance is stopped/paused
info!("Remove any stalled backups for paused instance {}", name);
removed_stalled_backups(cdb, ctx).await?;
info!("Fully reconciled stopped instance {}", name);
return Err(requeue_normal_with_jitter());
}
Expand Down

0 comments on commit d3e0fbf

Please sign in to comment.