Conversation
somaz94
marked this pull request as ready for review
September 23, 2026 01:54
somaz94
requested review from
FxKu,
Jan-M,
hughcapet,
idanovinda,
jopadi and
mikkeloscar
as code owners
September 23, 2026 01:54
Author
|
Thanks for the label and for merging master in. I've marked this ready for review. The unit tests pass, and the e2e failure is test_major_version_upgrade, which failed the same way on master in run 33736493007 on September 3. Since the suite stops at the first failure, the deletion tests after it did not run on this commit, so a re-run would cover those too. |
This branch has not been deployed
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.
Problem description
When a cluster is deleted, deleteService passes the cluster wide deleteOptions, which use DeletePropagationOrphan. The replica service has a selector, so its EndpointSlices are created by the EndpointSlice controller with the Service as owner. With orphan propagation the garbage collector only removes that owner reference, and the slices stay in the namespace after the Service is gone. The master service is not affected because its slices are mirrored from the Endpoints object the operator deletes itself, and the pooler services already use their own propagation policy in deleteConnectionPooler.
This change uses background propagation in deleteService only. The shared deleteOptions and the statefulset path stay as they are, since deleteStatefulSet orphans the pods on purpose and removes them itself.
A new unit test checks the propagation policy sent for the master and replica service deletes. It fails on master with Orphan and passes with this change. make mocks, make linux and go test -race ./... pass locally.
Linked issues
Fixes #2973
#2913 reports the same orphan behaviour for ControllerRevisions through the statefulset delete. I left it out of this PR so that change can be checked against the e2e tests on its own.
Checklist
Thanks for submitting a pull request to the Postgres Operator project.
Please, ensure your contribution matches the following items:
acid.zalan.doapi package.I used Claude Code to help investigate the issue and write the test.