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
[release-4.5] Bug 1904456: NetworkPolicy performance (pod caching) #229
[release-4.5] Bug 1904456: NetworkPolicy performance (pod caching) #229
Conversation
Rather than invoking the informer handlers directly, use a fake client and actually create/delete objects and let the informers be invoked normally. (In preparation for making use of the informer caches from the handlers.) Additionally, use a dummied-out BoundedFrequencyRunner to verify that syncs occur as expected.
Especially, we were previously copying all of the pods rather than just keeping pointers to the objects in the cache (probably a leftover from very old pre-shared-informer code). This may also fix leaks when pods are deleted and recreated, since informers apparently compress events based on namespace+name, not UID, so a delete+recreate would be compressed to an update, and we'd never get a delete for the old UID.
When syncing multiple namespaces, do them all in a single OVS transaction rather than a transaction per namespace
…cking In large clusters, recalculating networkpolicies after pod/namespace changes may take a lot of effort. Additionally, in some cases we may end up unnecessarily recalculating multiple times before pushing changes to OVS. Fix this by moving the recalculating step into the BoundedFrequencyRunner's thread, doing it just before we push the updates to OVS.
@openshift-cherrypick-robot: Bugzilla bug 1896958 has been cloned as Bugzilla bug 1904456. Retitling PR to link against new bug. 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. |
@openshift-cherrypick-robot: This pull request references Bugzilla bug 1904456, which is invalid:
Comment 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. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: danwinship, openshift-cherrypick-robot The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/bugzilla refresh Recalculating validity in case the underlying Bugzilla bug has changed. |
@openshift-bot: This pull request references Bugzilla bug 1904456, which is invalid:
Comment 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. |
/bugzilla refresh Recalculating validity in case the underlying Bugzilla bug has changed. |
@openshift-bot: This pull request references Bugzilla bug 1904456, which is invalid:
Comment 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. |
/bugzilla refresh Recalculating validity in case the underlying Bugzilla bug has changed. |
@openshift-bot: This pull request references Bugzilla bug 1904456, which is invalid:
Comment 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. |
/bugzilla refresh Recalculating validity in case the underlying Bugzilla bug has changed. |
@openshift-bot: This pull request references Bugzilla bug 1904456, which is invalid:
Comment 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. |
/bugzilla refresh Recalculating validity in case the underlying Bugzilla bug has changed. |
@openshift-bot: This pull request references Bugzilla bug 1904456, which is invalid:
Comment 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. |
/bugzilla refresh Recalculating validity in case the underlying Bugzilla bug has changed. |
@openshift-bot: This pull request references Bugzilla bug 1904456, which is invalid:
Comment 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. |
/bugzilla refresh Recalculating validity in case the underlying Bugzilla bug has changed. |
@openshift-bot: This pull request references Bugzilla bug 1904456, which is invalid:
Comment 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. |
/bugzilla refresh |
@danwinship: This pull request references Bugzilla bug 1904456, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 6 validation(s) were run on this bug
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. |
Hmm, are the changes in |
yes. The new unit test uses a fake kubeclient, which is something we weren't previously using so it needs to pull in a bunch of extra client-go code. Fortunately we hadn't rebased for a long time so the cherry-picked vendor updates are actually still correct for 4.5 |
Wow. |
"Fortunately" 😂 |
(patch manager) quite an invasive fix, backported from 4.6 and master, affects a real-world user |
@openshift-cherrypick-robot: All pull requests linked via external trackers have merged: Bugzilla bug 1904456 has been moved to the MODIFIED state. 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. |
This is an automated cherry-pick of #226
/assign danwinship