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

Scheduler should use pod UID instead of "namespace/name" in its cache #60966

Closed
bsalamat opened this issue Mar 9, 2018 · 4 comments · Fixed by #61069
Closed

Scheduler should use pod UID instead of "namespace/name" in its cache #60966

bsalamat opened this issue Mar 9, 2018 · 4 comments · Fixed by #61069
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling.

Comments

@bsalamat
Copy link
Member

bsalamat commented Mar 9, 2018

The key that scheduler uses to store a pod in its "assume" cache is "namespace/name" of the pod. As I explained in #56682 (comment), this can cause issues if a pod that is being scheduled is deleted and a replacement pod with the same name and namespace is created. In order to avoid this problem, scheduler should use pod UID instead of "namespace/name" as the key in its "assume" cache.

Is this a BUG REPORT or FEATURE REQUEST?:

/kind bug

/sig scheduling

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. labels Mar 9, 2018
@dixudx
Copy link
Member

dixudx commented Mar 9, 2018

scheduler should use pod UID instead of "namespace/name" as the key in its "assume" cache.

@bsalamat I am wondering whether pod.UID is always a non-empty string.

@bsalamat
Copy link
Member Author

bsalamat commented Mar 9, 2018

@dixudx Yes, UID must be non-empty in real clusters and if it is not, it is a bug in the API server: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids

That said, most of our scheduler tests do not set UID of the pods. So, this proposed change requires changes to our tests to ensure that UID is populated.

@vfreex
Copy link
Contributor

vfreex commented Mar 12, 2018

Using UID sounds reasonable to me!

@anfernee
Copy link
Member

/assign

anfernee pushed a commit to anfernee/kubernetes that referenced this issue Mar 13, 2018
UID uniquely identifies pods across lifecycles, while namespace/name
could be 2 different pods across lifecycles. This could result in
tricky scheduler bugs.

Fixes kubernetes#60966
resouer pushed a commit to resouer/kubernetes that referenced this issue May 18, 2018
UID uniquely identifies pods across lifecycles, while namespace/name
could be 2 different pods across lifecycles. This could result in
tricky scheduler bugs.

Fixes kubernetes#60966
prameshj pushed a commit to prameshj/kubernetes that referenced this issue Jun 1, 2018
UID uniquely identifies pods across lifecycles, while namespace/name
could be 2 different pods across lifecycles. This could result in
tricky scheduler bugs.

Fixes kubernetes#60966
tossmilestone pushed a commit to tossmilestone/kubernetes that referenced this issue Jul 25, 2018
UID uniquely identifies pods across lifecycles, while namespace/name
could be 2 different pods across lifecycles. This could result in
tricky scheduler bugs.

Fixes kubernetes#60966
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants