Skip to content
This repository has been archived by the owner on May 25, 2023. It is now read-only.

update node info no matter what node info changed #859

Merged
merged 1 commit into from
May 30, 2019

Conversation

wackxu
Copy link
Contributor

@wackxu wackxu commented May 25, 2019

we should update node info no matter what node info changed. for now, if node Conditions changed, we do not update the cache and pod may schedule on node that was not ready.

/assign @k82cn @hex108

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 25, 2019
@k8s-ci-robot k8s-ci-robot requested review from hzxuzhonghu and k82cn May 25, 2019 09:25
return !reflect.DeepEqual(oldNode.Status.Allocatable, newNode.Status.Allocatable) ||
!reflect.DeepEqual(oldNode.Spec.Taints, newNode.Spec.Taints) ||
!reflect.DeepEqual(oldNode.Labels, newNode.Labels) ||
!reflect.DeepEqual(oldNode.Spec.Unschedulable, newNode.Spec.Unschedulable)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it OK to add !reflect.DeepEqual(oldNode.Status.Conditions, newNode.Status.Conditions) here? There are a lot of NodeUpdate, and we do not need update it every time.

Copy link
Contributor

Choose a reason for hiding this comment

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

Check condition is better :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In default scheduler, no matter what node info changed, it always update the cache. There are not only node condition that we cared about when scheduling but also some other info, such as when we add ImageLocalityPriority, we need care about the change of node status Images info. I do not think it will have any benefits if we add more and more DeepEqual than we update the cache directly when node update.

Copy link
Contributor

Choose a reason for hiding this comment

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

hm... let's get this merged firstly; if any performance issue, let's enhance it in another PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

@hex108 , WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

OK with it.

@hex108
Copy link
Contributor

hex108 commented May 30, 2019

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 30, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hex108, wackxu

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 30, 2019
@k8s-ci-robot k8s-ci-robot merged commit c8a02d1 into kubernetes-retired:master May 30, 2019
@wackxu wackxu deleted the nodeinfoup branch May 30, 2019 06:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants