-
Notifications
You must be signed in to change notification settings - Fork 610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deletion of subscriptions occurs orphaned subscriber in channel implementaiton's spec #6636
Comments
Hi @WoWsj, thanks for reporting, I think, we should move to use Update to avoid this problem. Do you have capacity for a contribution? /triage accepted |
/area channel |
@pierDipi: The label(s) In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@pierDipi I see. I will make a PR to change |
Great! I temporarily set the eventing/pkg/client/injection/reconciler/messaging/v1/subscription/controller.go Line 104 in 271c9bb
eventing/vendor/knative.dev/pkg/controller/controller.go Lines 246 to 248 in 271c9bb
eventing/vendor/knative.dev/pkg/controller/controller.go Lines 57 to 64 in 271c9bb
|
Do you still plan to do this PR? |
@l-qing I think I can make a PR this week. I had no time to handle this issue recently 😭 . Is it an urgent thing for you? |
It's great! Looking forward to your good news.👍 |
Fixes #6636 <!-- Please include the 'why' behind your changes if no issue exists --> In `Subscription`'s reconcile loops, physical channel is updated by `PATCH` logic. It occurs broken sync between the channel and subscriptions. For ensuring a resource version which can check whether conflict occurred or not, change to `Update` with RetryOnConflict. ## Proposed Changes <!-- Please categorize your changes: - 🎁 Add new feature - 🐛 Fix bug - 🧹 Update or clean up current behavior - 🗑️ Remove feature or internal logic --> - Change Patch to Update - Use RetryOnConflict - Change condition when sync failed ### Pre-review Checklist <!-- If these boxes are not checked, you will be asked to complete these requirements or explain why they do not apply to your PR. --> - [ ] **At least 80% unit test coverage** - [ ] **E2E tests** for any new behavior - [ ] **Docs PR** for any user-facing impact - [ ] **Spec PR** for any new API feature - [ ] **Conformance test** for any change to the spec **Release Note** <!-- 📄 If this change has user-visible impact, write a release note in the block below. Include the string "action required" if additional action is required of users switching to the new release, for example in case of a breaking change. Write as if you are speaking to users, not other Knative contributors. If this change has no user-visible impact, no release note is needed. --> ```release-note ``` **Docs** <!-- 📖 If this change has user-visible impact, link to an issue or PR in https://github.com/knative/docs. --> # Open Questions If there are some users who are already affected by the bug related to this issue, this PR cannot fix them. What should we do? Co-authored-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
…6670) (#6724) This reverts commit 4d6e1fc. It has the side effect of dropping channel spec fields, so even immutable fields are dropped, hence channels will fail to get updated. We need to re-evalute the approach to fix the orginal issue: #6636, patch will always have edge cases that will lead the original bug because subscriptions are reconciled independently from each other (and potentially by multiple controller replicas), so update is the only way of having concurrency control at the resource level but we should make sure that we're preserving unknown fields when updating channelables.
…rce version (#6670) (#6725) This reverts commit 4d6e1fc. It has the side effect of dropping channel spec fields, so even immutable fields are dropped, hence channels will fail to get updated. We need to re-evalute the approach to fix the orginal issue: #6636, patch will always have edge cases that will lead the original bug because subscriptions are reconciled independently from each other (and potentially by multiple controller replicas), so update is the only way of having concurrency control at the resource level but we should make sure that we're preserving unknown fields when updating channelables.
…rce version (knative#6670) (knative#6725) This reverts commit knative@4d6e1fc. It has the side effect of dropping channel spec fields, so even immutable fields are dropped, hence channels will fail to get updated. We need to re-evalute the approach to fix the orginal issue: knative#6636, patch will always have edge cases that will lead the original bug because subscriptions are reconciled independently from each other (and potentially by multiple controller replicas), so update is the only way of having concurrency control at the resource level but we should make sure that we're preserving unknown fields when updating channelables.
* [release-1.9] Format Go code (knative#6706) This is an automated cherry-pick of knative#6702 Signed-off-by: Knative Automation <automation@knative.team> Co-authored-by: Knative Automation <automation@knative.team> * [release-1.9] Revert "Change subscription patch logic to ensure resource version (knative#6670) (knative#6725) This reverts commit knative@4d6e1fc. It has the side effect of dropping channel spec fields, so even immutable fields are dropped, hence channels will fail to get updated. We need to re-evalute the approach to fix the orginal issue: knative#6636, patch will always have edge cases that will lead the original bug because subscriptions are reconciled independently from each other (and potentially by multiple controller replicas), so update is the only way of having concurrency control at the resource level but we should make sure that we're preserving unknown fields when updating channelables. * [release-1.9] Scheduler doesn't reschedule vpods that are scheduled on unscehdulable pods (knative#6730) This is an automated cherry-pick of knative#6726 Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> Co-authored-by: Pierangelo Di Pilato <pierdipi@redhat.com> * [release-1.9] Improve scheduler logging for state and pending vpods (knative#6734) This is an automated cherry-pick of knative#6729 Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> Co-authored-by: Pierangelo Di Pilato <pierdipi@redhat.com> * [release-1.9] Add function to check if a broker resource is `NotReady` (knative#6738) This is an automated cherry-pick of knative#6737 Signed-off-by: Christoph Stäbler <cstabler@redhat.com> Co-authored-by: Christoph Stäbler <cstabler@redhat.com> * [release-1.9] Extract scheduler config in a dedicate struct instead of many parameters (knative#6740) This is an automated cherry-pick of knative#6736 Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> Co-authored-by: Pierangelo Di Pilato <pierdipi@redhat.com> * [release-1.9] Exclusive access to tracing flag for upgrade prober (knative#6768) This is an automated cherry-pick of knative#6767 ```release-note ``` Co-authored-by: Martin Gencur <mgencur@redhat.com> * [release-1.9] Upgrade to latest dependencies (knative#6775) bumping pkg -dprotaso /cc knative/eventing-writers /assign knative/eventing-writers Produced by: knative-sandbox/knobots/actions/update-deps Signed-off-by: Knative Automation <automation@knative.team> --------- Signed-off-by: Knative Automation <automation@knative.team> Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> Signed-off-by: Christoph Stäbler <cstabler@redhat.com> Co-authored-by: Knative Prow Robot <knative-prow-robot@google.com> Co-authored-by: Knative Automation <automation@knative.team> Co-authored-by: Christoph Stäbler <cstabler@redhat.com> Co-authored-by: Martin Gencur <mgencur@redhat.com>
Describe the bug
eventing/pkg/reconciler/subscription/subscription.go
Lines 439 to 470 in e63b13c
It seems like:
subscriptions
makeseventing-controller
handle finalizers for the subscriptions.eventing-controller
handle finalizers simultaneously.patchSubscription
usePATCH
API, so it cannot ensure the resource version.Expected behavior
If a subscription is deleted, an element in
subscriber
in physical channel's spec will be deleted if the uid is the same.To Reproduce
https://gist.github.com/WoWsj/3630deaa315fbc70043449231a4eaa1d
Knative release version
v1.8.2
Additional context
None
Questions
Is there any specific reason to use
Patch
, notUpdate
?I think Using
Update
withretryOnConflict
is more proper way to ensure the resource versions in this case...The text was updated successfully, but these errors were encountered: