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

hotfix when a plugin (in-tree or out-of-tree) return non-existent/illegal nodes, the pod scheduling flow will abort immediately. #124559

Merged

Conversation

chengjoey
Copy link
Contributor

@chengjoey chengjoey commented Apr 26, 2024

What type of PR is this?

/kind bug

What this PR does / why we need it:

this is a minimum fix from #119779
In versions 1.27-1.29, if there is a non-existent node in the PreFilterResult, the pod schedule will fail.

Which issue(s) this PR fixes:

Fixes #123465

Special notes for your reviewer: @Huang-Wei @alculquicondor

Does this PR introduce a user-facing change?

Fixed a bug that a pod may remain unscheduled if any PreFilter plugin returns nodes that do not exist.

@k8s-ci-robot k8s-ci-robot added this to the v1.29 milestone Apr 26, 2024
@k8s-ci-robot k8s-ci-robot added do-not-merge/cherry-pick-not-approved Indicates that a PR is not yet approved to merge into a release branch. kind/bug Categorizes issue or PR as related to a bug. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. 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. labels Apr 26, 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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 26, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @chengjoey. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added needs-priority Indicates a PR lacks a `priority/foo` label and requires one. 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 Apr 26, 2024
@alculquicondor
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 26, 2024
@alculquicondor
Copy link
Member

Also, let's wait for #124539 to merge and also cherry-pick in this same PR.

@chengjoey
Copy link
Contributor Author

/test pull-kubernetes-unit

@chengjoey
Copy link
Contributor Author

/test pull-kubernetes-unit-go-compatibility

@alculquicondor
Copy link
Member

alculquicondor commented Apr 26, 2024

I don't think the tests are flaky. Maybe they are making some assumptions about the nodes existing.

If it becomes too much burden to fix them, I think we should just cherry-pick the entire original PR #119779

@chengjoey chengjoey force-pushed the hotfix/scheduler-illegal-node branch from 27c4ec4 to 6e12ecf Compare April 27, 2024 01:24
@chengjoey
Copy link
Contributor Author

I don't think the tests are flaky. Maybe they are making some assumptions about the nodes existing.

If it becomes too much burden to fix them, I think we should just cherry-pick the entire original PR #119779

the tests are not flaky, but the original PR 119779 also modified the test, but the test was not changed just now, so it is normal now
image

@Huang-Wei
Copy link
Member

It's b/c @sanposhiho 's PR introduced a change to set UnschedulableAndUnresolvable to each node that's filtered out by PreFilterResult:

if !preRes.AllNodes() {
nodes = make([]*framework.NodeInfo, 0, len(preRes.NodeNames))
for _, n := range allNodes {
if !preRes.NodeNames.Has(n.Node().Name) {
// We consider Nodes that are filtered out by PreFilterResult as rejected via UnschedulableAndUnresolvable.
// We have to record them in NodeToStatusMap so that they won't be considered as candidates in the preemption.
diagnosis.NodeToStatusMap[n.Node().Name] = framework.NewStatus(framework.UnschedulableAndUnresolvable, "node is filtered out by the prefilter result")
continue
}
nodes = append(nodes, n)
}
}

And the logic of counting processedNodes is based on feasibleNodes and diagnosis.NodeToStatusMap:

processedNodes := len(feasibleNodes) + len(diagnosis.NodeToStatusMap)

So it caused the UT's change, but it's not a big issue IMHO.

@chengjoey could you also incorporate d382150 into this PR?

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. area/test and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 28, 2024
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 6, 2024
@k8s-ci-robot k8s-ci-robot removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 6, 2024
@chengjoey
Copy link
Contributor Author

cherry-pick #124714
preallocation for NodeToStatusMap

@sanposhiho
Copy link
Member

cherry-pick #124714
preallocation for NodeToStatusMap

@chengjoey Please exclude it from this PR. The cheery-pick for mine should be separated. I'll prepare the one.

@sanposhiho
Copy link
Member

sanposhiho commented May 8, 2024

Oh, wait. @alculquicondor, did you intend to include a cherry-pick for #124709 in this PR?
I thought we should prepare a separate one not to include multiple bug fixes in one PR.

Sorry, this will require more work. See #124709 for details
#124559 (comment)

@chengjoey
Copy link
Contributor Author

/test pull-kubernetes-integration-go-compatibility

@alculquicondor
Copy link
Member

/hold cancel
#124753 targets 1.30.

This PR targets 1.29 and older. We need to include #124714 here.

@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 May 8, 2024
@alculquicondor
Copy link
Member

I thought we should prepare a separate one not to include multiple bug fixes in one PR.

1.29 and older are currently unaffected. They will only be affected if this PR merges. Thus, we should include the performance fix.

@alculquicondor
Copy link
Member

/approve
/lgtm
/cc kubernetes/release-managers

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

LGTM label has been added.

Git tree hash: 693334c8e36df57a41a6a3bbb24eab62fa8f607a

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alculquicondor, chengjoey

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 8, 2024
@alculquicondor
Copy link
Member

Anything we are missing? otherwise, I think you can prepare the cherry-picks for 1.28 and 1.27 based on this PR

@chengjoey
Copy link
Contributor Author

there are some conflicts in schedule_one_test, in 1.27 and 1.28, so manual cherry-pick

@alculquicondor
Copy link
Member

/kind regression

@k8s-ci-robot k8s-ci-robot added the kind/regression Categorizes issue or PR as related to a regression from a prior release. label May 9, 2024
k8s-ci-robot added a commit that referenced this pull request May 10, 2024
…59-upstream-release-1.27

Manual cherry pick of #124559 upstream release 1.27
Copy link

@Verolop Verolop left a comment

Choose a reason for hiding this comment

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

/lgtm
(Release Managers)

@Verolop Verolop added the cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. label May 10, 2024
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/cherry-pick-not-approved Indicates that a PR is not yet approved to merge into a release branch. label May 10, 2024
k8s-ci-robot added a commit that referenced this pull request May 10, 2024
…59-upstream-release-1.28

Manual cherry pick of #124559 upstream release 1.28
@k8s-triage-robot
Copy link

The Kubernetes project has merge-blocking tests that are currently too flaky to consistently pass.

This bot retests PRs for certain kubernetes repos according to the following rules:

  • The PR does have any do-not-merge/* labels
  • The PR does not have the needs-ok-to-test label
  • The PR is mergeable (does not have a needs-rebase label)
  • The PR is approved (has cncf-cla: yes, lgtm, approved labels)
  • The PR is failing tests required for merge

You can:

/retest

@k8s-ci-robot k8s-ci-robot merged commit a2068b2 into kubernetes:release-1.29 May 11, 2024
17 checks passed
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/test cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. 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. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

7 participants