Repository navigation
fix(controller): recover owned resource cleanup for deleted clusters - #11229
Merged
litaocdl merged 1 commit intoJul 21, 2026
Conversation
GabriFedi97
force-pushed
the
review/fix-orphan-finalizer-strip
branch
2 times, most recently
from
July 20, 2026 14:48
826e0aa to
453ad58
Compare
GabriFedi97
marked this pull request as ready for review
July 20, 2026 14:50
The owned-resource watches that re-run notifyDeletionToOwnedResources after a restart only fired for resources already carrying a deletionTimestamp. Because the Cluster has no finalizer, deleting only the Cluster (rather than the whole namespace) leaves the Database, Publication and Subscription objects without a deletionTimestamp of their own. On restart their initial cache-sync events were dropped by the predicate, the Cluster was already gone so nothing else enqueued a reconcile, and the finalizers were never stripped. Admit the initial-list create events so the cleanup runs on restart regardless of whether the owned resource is itself being deleted; Also watch DatabaseRole, whose finalizer is likewise managed by the instance manager and carries the same orphan risk. Assisted-by: Claude Opus 4.8 Signed-off-by: Gabriele Fedi <[email protected]>
GabriFedi97
force-pushed
the
review/fix-orphan-finalizer-strip
branch
from
July 21, 2026 07:58
453ad58 to
f8ba34c
Compare
litaocdl
merged this pull request
into
cloudnative-pg:dev/fix-orphan-finalizer-strip
Jul 21, 2026
5 checks passed
mnencia
pushed a commit
that referenced
this pull request
Jul 22, 2026
…11229) The owned-resource watches that re-run `notifyDeletionToOwnedResources` after a restart only fired for resources already carrying a deletionTimestamp. Because the Cluster has no finalizer, deleting only the Cluster (rather than the whole namespace) leaves the `Database`, `Publication`, `Subscription` and `DatabaseRole` objects without a deletionTimestamp of their own. On restart their initial cache-sync events were dropped by the predicate, the Cluster was already gone so nothing else enqueued a reconcile, and the finalizers were never stripped. Admit the initial-list create events so the cleanup runs on restart regardless of whether the owned resource is itself being deleted; Also watch DatabaseRole, whose finalizer is likewise managed by the instance manager and carries the same orphan risk. Refs #10535 Signed-off-by: Gabriele Fedi <[email protected]>
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.
The owned-resource watches that re-run
notifyDeletionToOwnedResourcesafter a restart only fired for resources already carrying a deletionTimestamp. Because the Cluster has no finalizer, deleting only the Cluster (rather than the whole namespace) leaves theDatabase,Publication,SubscriptionandDatabaseRoleobjects without a deletionTimestamp of their own. On restart their initial cache-sync events were dropped by the predicate, the Cluster was already gone so nothing else enqueued a reconcile, and the finalizers were never stripped.Admit the initial-list create events so the cleanup runs on restart regardless of whether the owned resource is itself being deleted;
Also watch DatabaseRole,
whose finalizer is likewise managed by the instance manager and carries the same orphan risk.
Refs #10535