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: when "pd.replicas = 1" the pod always is pending and cannot be scheduled #350

Closed
xiaojingchen opened this issue Mar 25, 2019 · 0 comments · Fixed by #351
Closed
Labels
type/bug Something isn't working

Comments

@xiaojingchen
Copy link
Contributor

when "pd.replicas = 1", scheduler can not scheduler pod.
the scheduler print the log:

E0325 06:13:12.789915       1 mux.go:107] unable to filter nodes: can't find a node from
nodeMap: map[172.16.4.179:[] 172.16.4.182:[] 172.16.4.177:[] 172.16.4.178:[] 172.16.4.181:[] 172.16.4.180:[]]

then check the tidb-scheduler ha logic, found our scheduler can not support the situation when replicas==1

for nodeName, podNames := range nodeMap {
		podsCount := len(podNames)
		if podsCount+1 >= int(replicas+1)/2 {     
			continue
		}
		if min == -1 {
			min = podsCount
		}

		if podsCount > min {
			continue
		}
		if podsCount < min {
			min = podsCount
			minNodeNames = make([]string, 0)
		}
		minNodeNames = append(minNodeNames, nodeName)
}

the expression if podsCount+1 >= int(replicas+1)/2 is alway true when replicas is 1, we need to fix the expression.
@weekface @tennix PTAL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant