Skip to content
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

Avoid deep-copying object when possible on kube-apiserver watch path #108252

Merged
merged 3 commits into from
Mar 9, 2022

Conversation

wojtek-t
Copy link
Member

Visibly based on #104802 by @sttts

After removing support in kube-apiserver to set selflink kubernetes/enhancements#1164, kube-apiserver is not really modifying the objects that it's getting on the watch path.
As a result, we can optimize the lower layers of kube-apiserver (watchcache) to avoid unnecessary deep-copies of those objects as they are no longer necessary.

NONE

/kind cleanup
/priority important-soon
/sig api-machinery

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 21, 2022
@wojtek-t
Copy link
Member Author

/hold

To address the remaining TODO in the code.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 21, 2022
@wojtek-t
Copy link
Member Author

/assign @sttts @liggitt

@p0lyn0mial - FYI

@k8s-ci-robot k8s-ci-robot added area/apiserver approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Feb 21, 2022
@wojtek-t wojtek-t force-pushed the avoid_object_deep_copies branch 2 times, most recently from e2c1ada to c1c1661 Compare February 21, 2022 15:53
@wojtek-t
Copy link
Member Author

I fixed the race that was causing test failures above.

@wojtek-t
Copy link
Member Author

OK - this is now ready for full review.

/hold cancel

/retest

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 21, 2022
@sttts
Copy link
Contributor

sttts commented Feb 22, 2022

Lgtm.

Letting @liggitt to take another look.

Copy link
Member Author

@wojtek-t wojtek-t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/hold

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 22, 2022
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 23, 2022
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 23, 2022
@wojtek-t
Copy link
Member Author

@liggitt - PTAL

@wojtek-t
Copy link
Member Author

/retest

@wojtek-t
Copy link
Member Author

/retest

@wojtek-t
Copy link
Member Author

@liggitt - PTAL when you will have a chance

Copy link
Member Author

@wojtek-t wojtek-t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@liggitt - thanks for comments! PTAL

@wojtek-t
Copy link
Member Author

wojtek-t commented Mar 1, 2022

@liggitt - tests fixed, PTAL

Copy link
Member Author

@wojtek-t wojtek-t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@liggitt - PTAL

@liggitt
Copy link
Member

liggitt commented Mar 8, 2022

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 8, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liggitt, wojtek-t

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@wojtek-t
Copy link
Member Author

wojtek-t commented Mar 9, 2022

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 9, 2022
@k8s-ci-robot k8s-ci-robot merged commit 9946b53 into kubernetes:master Mar 9, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.24 milestone Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/apiserver cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-none Denotes a PR that doesn't merit a release note. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants