Skip to content

fix: enter deletion path immediately when cluster is being deleted#9555

Merged
leonardoce merged 3 commits intomainfrom
dev/9554
Dec 23, 2025
Merged

fix: enter deletion path immediately when cluster is being deleted#9555
leonardoce merged 3 commits intomainfrom
dev/9554

Conversation

@mnencia
Copy link
Member

@mnencia mnencia commented Dec 22, 2025

When a cluster has DeletionTimestamp set, skip normal reconciliation and enter the deletion path immediately. This prevents accumulating exponential backoff from failed attempts to create resources in a terminating namespace.

Additionally, handle optimistic locking conflicts during finalizer removal by requeueing after 1 second instead of returning an error, avoiding unnecessary backoff delays.

Closes #9554

@mnencia mnencia requested a review from a team as a code owner December 22, 2025 16:46
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Dec 22, 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 22, 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

@mnencia
Copy link
Member Author

mnencia commented Dec 22, 2025

/test

@dosubot dosubot bot added bug 🐛 Something isn't working ok to merge 👌 This PR can be merged labels Dec 22, 2025
@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/20438239063

@mnencia mnencia removed the ok to merge 👌 This PR can be merged label Dec 22, 2025
@mnencia mnencia force-pushed the dev/9554 branch 2 times, most recently from e811c21 to d88668a Compare December 22, 2025 17:28
@cnpg-bot cnpg-bot added the ok to merge 👌 This PR can be merged label Dec 22, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Dec 23, 2025
mnencia and others added 3 commits December 23, 2025 17:27
When a cluster has DeletionTimestamp set, skip normal reconciliation
and enter the deletion path immediately. This prevents accumulating
exponential backoff from failed attempts to create resources in a
terminating namespace.

Additionally, handle optimistic locking conflicts during finalizer
removal by requeueing after 1 second instead of returning an error,
avoiding unnecessary backoff delays.

Closes #9554

Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
@leonardoce leonardoce merged commit 36b2304 into main Dec 23, 2025
28 checks passed
@leonardoce leonardoce deleted the dev/9554 branch December 23, 2025 16:35
cnpg-bot pushed a commit that referenced this pull request Dec 23, 2025
…9555)

When a cluster has DeletionTimestamp set, skip normal reconciliation and
enter the deletion path immediately. This prevents accumulating
exponential backoff from failed attempts to create resources in a
terminating namespace.

Additionally, handle optimistic locking conflicts during finalizer
removal by requeueing after 1 second instead of returning an error,
avoiding unnecessary backoff delays.

Closes #9554

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 36b2304)
cnpg-bot pushed a commit that referenced this pull request Dec 23, 2025
…9555)

When a cluster has DeletionTimestamp set, skip normal reconciliation and
enter the deletion path immediately. This prevents accumulating
exponential backoff from failed attempts to create resources in a
terminating namespace.

Additionally, handle optimistic locking conflicts during finalizer
removal by requeueing after 1 second instead of returning an error,
avoiding unnecessary backoff delays.

Closes #9554

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 36b2304)
cnpg-bot pushed a commit that referenced this pull request Dec 23, 2025
…9555)

When a cluster has DeletionTimestamp set, skip normal reconciliation and
enter the deletion path immediately. This prevents accumulating
exponential backoff from failed attempts to create resources in a
terminating namespace.

Additionally, handle optimistic locking conflicts during finalizer
removal by requeueing after 1 second instead of returning an error,
avoiding unnecessary backoff delays.

Closes #9554

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 36b2304)
mnencia added a commit that referenced this pull request Jan 20, 2026
…9555)

When a cluster has DeletionTimestamp set, skip normal reconciliation and
enter the deletion path immediately. This prevents accumulating
exponential backoff from failed attempts to create resources in a
terminating namespace.

Additionally, handle optimistic locking conflicts during finalizer
removal by requeueing after 1 second instead of returning an error,
avoiding unnecessary backoff delays.

Closes #9554

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 36b2304)
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:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Database finalizer removal slow when deleting namespace due to exponential backoff

4 participants