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

Fix list estimator for lists that are executed as gets #112557

Merged
merged 1 commit into from Sep 19, 2022

Conversation

marseel
Copy link
Member

@marseel marseel commented Sep 19, 2022

What type of PR is this?

/kind bug

What this PR does / why we need it:

Currently, some of the LIST requests which are handled as GET requests are going through list work estimator and are assigned incorrect width. Examples:

"HTTP" verb="GET" URI="/apis/certificates.k8s.io/v1/certificatesigningrequests?fieldSelector=metadata.name%3Dcsr-xxs4m" latency="791.275274ms" userAgent="kubelet/v1.25.0 (linux/amd64) kubernetes/eac9e5e" audit-ID="48dc5a58-dd54-4813-9291-fcb956fb0365" srcIP="10.227.1.187:50020" apf_pl="system" apf_fs="system-nodes" apf_iseats=10 apf_fseats=0 apf_additionalLatency="0s" fl_priorityandfairness="779.056278ms" apf_execution_time="11.345816ms" resp=200
"HTTP" verb="GET" URI="/api/v1/namespaces/test-6rmmu0-50/configmaps?fieldSelector=metadata.name%3Dbig-deployment-1&limit=500&resourceVersion=0" latency="471.626µs" userAgent="kubelet/v1.25.0 (linux/amd64) kubernetes/eac9e5e" audit-ID="7c3ddba4-5cb9-43a9-af3f-740b9da44d89" srcIP="10.125.76.42:49794" apf_pl="system" apf_fs="system-nodes" apf_iseats=10 apf_fseats=0 apf_additionalLatency="0s" apf_execution_time="208.981µs" resp=200

This PR fixes it by assigning 1 seat for such requests.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Fix 1.23 regression in list cost estimation in Priority and Fairness for list requests with metadata.name specified.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. area/apiserver sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Sep 19, 2022
@aojea
Copy link
Member

aojea commented Sep 19, 2022

/assign @wojtek-t @MikeSpreitzer @tkashem

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Sep 19, 2022
Copy link
Member

@MikeSpreitzer MikeSpreitzer left a comment

Choose a reason for hiding this comment

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

/lgtm
Thanks!

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: marseel, MikeSpreitzer

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 19, 2022
@k8s-ci-robot k8s-ci-robot merged commit 497e0df into kubernetes:master Sep 19, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.26 milestone Sep 19, 2022
// requests in storage layer so their width should be 1.
// Example of such list requests:
// /apis/certificates.k8s.io/v1/certificatesigningrequests?fieldSelector=metadata.name%3Dcsr-xxs4m
// /api/v1/namespaces/test/configmaps?fieldSelector=metadata.name%3Dbig-deployment-1&limit=500&resourceVersion=0
Copy link
Contributor

Choose a reason for hiding this comment

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

question: is the cost same as a regular GET on etcd side, i see fieldSelector in the request URI. I am not very familiar with the storage logic, just wondering whether it will be as expensive as a regular LIST on the etcd side.

Copy link
Member

Choose a reason for hiding this comment

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

I will look into this.

Copy link
Member

Choose a reason for hiding this comment

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

cf #85445

Copy link
Member

Choose a reason for hiding this comment

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

@leilajal
Copy link
Contributor

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Sep 20, 2022
@wojtek-t
Copy link
Member

@marseel - I think we should consider cherrypicking this.

@marseel
Copy link
Member Author

marseel commented Sep 21, 2022

I think it makes sense to backport it back to 1.23 where we introduced width for list requests.

k8s-ci-robot added a commit that referenced this pull request Sep 27, 2022
…557-upstream-release-1.23

Automated cherry pick of #112557: Fix list estimator for lists that are executed as gets
k8s-ci-robot added a commit that referenced this pull request Sep 27, 2022
…557-upstream-release-1.24

Automated cherry pick of #112557: Fix list estimator for lists that are executed as gets
k8s-ci-robot added a commit that referenced this pull request Sep 27, 2022
…557-upstream-release-1.25

Automated cherry pick of #112557: Fix list estimator for lists that are executed as gets
@liggitt liggitt added the kind/regression Categorizes issue or PR as related to a regression from a prior release. label Jan 30, 2023
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/bug Categorizes issue or PR as related to a bug. kind/regression Categorizes issue or PR as related to a regression from a prior release. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/M Denotes a PR that changes 30-99 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

8 participants