Skip to content

fix: properly return errors when removing Database finalizers#9431

Merged
leonardoce merged 2 commits intomainfrom
dev/9430
Dec 15, 2025
Merged

fix: properly return errors when removing Database finalizers#9431
leonardoce merged 2 commits intomainfrom
dev/9430

Conversation

@mnencia
Copy link
Member

@mnencia mnencia commented Dec 14, 2025

Closes #9430

@mnencia mnencia requested a review from a team as a code owner December 14, 2025 23:43
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Dec 14, 2025
@cnpg-bot cnpg-bot added backport-requested ◀️ This pull request should be backported to all supported releases release-1.25 release-1.27 release-1.28 labels Dec 14, 2025
@github-actions
Copy link
Contributor

❗ By default, the pull request is configured to backport to all release branches.

  • To stop backporting this pr, remove the label: backport-requested ◀️ or add the label 'do not backport'
  • To stop backporting this pr to a certain release branch, remove the specific branch label: release-x.y

@dosubot dosubot bot added bug 🐛 Something isn't working ok to merge 👌 This PR can be merged labels Dec 14, 2025
@mnencia mnencia removed the ok to merge 👌 This PR can be merged label Dec 15, 2025
@mnencia
Copy link
Member Author

mnencia commented Dec 15, 2025

/test

@github-actions
Copy link
Contributor

@mnencia, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/20222740439

@cnpg-bot cnpg-bot added the ok to merge 👌 This PR can be merged label Dec 15, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Dec 15, 2025
@armru
Copy link
Member

armru commented Dec 15, 2025

/test limit=local

@github-actions
Copy link
Contributor

@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/20230890606

mnencia and others added 2 commits December 15, 2025 16:54
When a Cluster is deleted, the operator attempts to remove finalizers
from owned Database objects via notifyDeletionToOwnedResources().
However, errors from this function were being logged but not returned
due to variable shadowing with :=, causing the reconciler to return
success even when finalizer removal failed.

This meant Kubernetes would not requeue the reconciliation, leaving
Database finalizers orphaned permanently.

The fix collects errors from both deleteDanglingMonitoringQueries
and notifyDeletionToOwnedResources, then returns them via errors.Join
to ensure proper reconciliation retry on failure.

Related to #9430

Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
@mnencia
Copy link
Member Author

mnencia commented Dec 15, 2025

/ok-to-merge E2E green, one unrelated failure

@leonardoce leonardoce merged commit aa2b911 into main Dec 15, 2025
31 of 34 checks passed
@leonardoce leonardoce deleted the dev/9430 branch December 15, 2025 16:05
cnpg-bot pushed a commit that referenced this pull request Dec 15, 2025
Closes #9430

Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Co-authored-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
(cherry picked from commit aa2b911)
cnpg-bot pushed a commit that referenced this pull request Dec 15, 2025
Closes #9430

Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Co-authored-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
(cherry picked from commit aa2b911)
cnpg-bot pushed a commit that referenced this pull request Dec 15, 2025
Closes #9430

Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Co-authored-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
(cherry picked from commit aa2b911)
mnencia added a commit that referenced this pull request Jan 20, 2026
Closes #9430

Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Co-authored-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
(cherry picked from commit aa2b911)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-requested ◀️ This pull request should be backported to all supported releases bug 🐛 Something isn't working lgtm This PR has been approved by a maintainer ok to merge 👌 This PR can be merged release-1.25 release-1.27 release-1.28 size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Flaky E2E test - Database namespace deletion with finalizers times out

4 participants