-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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
Send correct resource version for delete events from watch cache #58547
Send correct resource version for delete events from watch cache #58547
Conversation
e081817
to
57998d2
Compare
@kubernetes/sig-api-machinery-bugs @kubernetes/sig-api-machinery-pr-reviews |
/status approved-for-milestone |
@@ -73,79 +77,88 @@ func TestCacheWatcherHandlesFiltering(t *testing.T) { | |||
{ | |||
events: []*watchCacheEvent{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this diff is best viewed without whitespace:
https://github.com/kubernetes/kubernetes/pull/58547/files?w=1
this makes the test data accurate (events have resource versions), and actually tests for the result we want (delete event is delivered with the resource version of the event that caused it, not the last modified resourceVersion of the object, otherwise watch events would be able to have resourceVersions that went back in time, and caused re-watch to start from old points in history)
/retest Review the full test history for this PR. Silence the bot with an |
/retest |
/test all [submit-queue is verifying that this PR is safe to merge] |
/test pull-kubernetes-e2e-kops-aws |
/test all [submit-queue is verifying that this PR is safe to merge] |
/retest |
Automatic merge from submit-queue (batch tested with PRs 58547, 57228, 58528, 58499, 58618). If you want to cherry-pick this change to another branch, please follow the instructions here. |
@liggitt: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
Automatic merge from submit-queue (batch tested with PRs 18233, 18068, 18228, 18227). UPSTREAM: 58547: Send correct resource version for delete events from watch cache Backport of kubernetes/kubernetes#58547 Watch cache was returning incorrect (old) ResourceVersion on "deleted" events breaking informers that were going back in time. This fixes it. /assign @liggitt /cc @mfojtik Fixes #17581 #16003 and likely others
…e-fix-58547 Automatic merge from submit-queue (batch tested with PRs 18233, 18068, 18228, 18227). UPSTREAM: 58547: Send correct resource version for delete events from watch cache Backport of kubernetes#58547 Watch cache was returning incorrect (old) ResourceVersion on "deleted" events breaking informers that were going back in time. This fixes it. /assign @liggitt /cc @mfojtik Fixes openshift/origin#17581 openshift/origin#16003 and likely others Origin-commit: 042a63f8c1effc2fb911ce2cf494458872e9f8a3
Commit found in the "release-1.9" branch appears to be this PR. Removing the "cherrypick-candidate" label. If this is an error find help to get your PR picked. |
…ect resource version for delete events from watch Origin-commit: 346464d764b9f9a96ea29d41a8a3e3ca1b219468
…e-fix-58547-release-3.8 Automatic merge from submit-queue. [3.8] UPSTREAM: 58571: Automated cherry pick of kubernetes#58547: Send correct resource version for delete events from watch Backport of openshift/origin#18233 via kubernetes#58571 /assign @liggitt Origin-commit: 360fac5be27896518ad01b63a0ea132174af23e8
…e-fix-58547 Automatic merge from submit-queue (batch tested with PRs 18233, 18068, 18228, 18227). UPSTREAM: 58547: Send correct resource version for delete events from watch cache Backport of kubernetes#58547 Watch cache was returning incorrect (old) ResourceVersion on "deleted" events breaking informers that were going back in time. This fixes it. /assign @liggitt /cc @mfojtik Fixes openshift/origin#17581 openshift/origin#16003 and likely others Origin-commit: 042a63f8c1effc2fb911ce2cf494458872e9f8a3
Automatic merge from submit-queue (batch tested with PRs 18233, 18068, 18228, 18227). UPSTREAM: 58547: Send correct resource version for delete events from watch cache Backport of kubernetes/kubernetes#58547 Watch cache was returning incorrect (old) ResourceVersion on "deleted" events breaking informers that were going back in time. This fixes it. /assign @liggitt /cc @mfojtik Fixes openshift/origin#17581 openshift/origin#16003 and likely others Origin-commit: 042a63f8c1effc2fb911ce2cf494458872e9f8a3 Kubernetes-commit: b1d49808af3db35be42e4b705953d656a21bc201
…e, fixed official version kubernetes#58547
Fixes #58545
Fixes kubernetes/client-go#338
the watch cache filtering is returning the previous object content intact, including resource version. this is the logic the watch cache uses:
when processing a delete event, we should be sending the old object's content but with the event's resource version set in it. corresponding logic exists in the uncached stores:
kubernetes/staging/src/k8s.io/apiserver/pkg/storage/etcd/etcd_watcher.go
Lines 401 to 403 in 77ac663
kubernetes/staging/src/k8s.io/apiserver/pkg/storage/etcd3/watcher.go
Lines 373 to 378 in 77ac663