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

Change EvaluatedNodes to count Nodes that reach Filter phase only #124735

Merged
merged 1 commit into from May 10, 2024

Conversation

AxeZhan
Copy link
Member

@AxeZhan AxeZhan commented May 8, 2024

What type of PR is this?

/kind feature

What this PR does / why we need it:

Currently, EvaluatedNodes contains the number of nodes that filtered out by PreFilterResult and Filter plugins.
In this pr, it's changed back to only contains Nodes reach Filter plugins, same as before #119779

Which issue(s) this PR fixes:

Fixes #124705

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Scheduler changes its logic of calculating `evaluatedNodes` from "contains the number of nodes that filtered out by PreFilterResult and Filter plugins" to "the number of nodes filtered out by Filter plugins only".

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/M Denotes a PR that changes 30-99 lines, ignoring generated files. kind/feature Categorizes issue or PR as related to a new feature. 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. labels May 8, 2024
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label May 8, 2024
@k8s-ci-robot k8s-ci-robot added sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels May 8, 2024
@@ -594,6 +594,7 @@ func (sched *Scheduler) findNodesThatPassFilters(
for i := range feasibleNodes {
feasibleNodes[i] = nodes[(sched.nextStartNodeIndex+i)%numAllNodes]
}
diagnosis.EvaluatedNodes = len(feasibleNodes)
Copy link
Member Author

@AxeZhan AxeZhan May 8, 2024

Choose a reason for hiding this comment

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

This is same as the old logic(before #119779), however it seems a little weird to me.
As we don't actually evaluate some pods here(there is no filter plugin), I think evaluatedNodes equal to 0 in this scenario is more reasonable to me.
WDYT @alculquicondor @sanposhiho

Copy link
Member

Choose a reason for hiding this comment

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

I'm fine with this

@AxeZhan AxeZhan force-pushed the evaluatedNodes branch 2 times, most recently from 7030d89 to 1a82e82 Compare May 8, 2024 08:08
@@ -2143,6 +2149,7 @@ func TestSchedulerSchedulePod(t *testing.T) {
"3": framework.NewStatus(framework.Unschedulable, "injecting failure for pod test-filter").WithPlugin("FakeFilter"),
},
UnschedulablePlugins: sets.New("FakeFilter", framework.ExtenderName),
EvaluatedNodes: 3,
Copy link
Member

Choose a reason for hiding this comment

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

why are these values changing?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because I added a new field to type Diagnosis struct.
And in these test cases, we use reflect.deepequal to compare two fitError, so it will compare the new field EvaluatedNodes too.
It is set to 0 default, which is inconsistent with the real situation.

@@ -594,6 +594,7 @@ func (sched *Scheduler) findNodesThatPassFilters(
for i := range feasibleNodes {
feasibleNodes[i] = nodes[(sched.nextStartNodeIndex+i)%numAllNodes]
}
diagnosis.EvaluatedNodes = len(feasibleNodes)
Copy link
Member

Choose a reason for hiding this comment

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

I'm fine with this

@alculquicondor
Copy link
Member

/lgtm
@sanposhiho I'll leave the approval to you

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

LGTM label has been added.

Git tree hash: b09d16286e866d79a2a22ee20b59e61e8bd2c6e7

pkg/scheduler/schedule_one.go Outdated Show resolved Hide resolved
pkg/scheduler/framework/types.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 10, 2024
Copy link
Member

@sanposhiho sanposhiho left a comment

Choose a reason for hiding this comment

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

/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 May 10, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 4102c726233540ff450ba93e1031e48f8e93761f

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AxeZhan, sanposhiho

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 May 10, 2024
@k8s-ci-robot k8s-ci-robot merged commit 9d87fa2 into kubernetes:master May 10, 2024
14 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.31 milestone May 10, 2024
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. 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. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change EvaluatedNodes to count Nodes that reach Filter phase only
4 participants