Closed PengJi closed 4 years ago
maybe there is a race in the code, can you investigate it?
@cofyc This error occurs mainly in the following cases.
Supposing zone1 has two hosts: host1 and Host2, one pod is scheduled to host1, when another pod is scheduled, nodes is the parameters of scheduler-extender func (h * HA) Filter(instanceName String, pod * apiv1.pod, nodes [] apiv1.node) (Error)
, nodes may not contain host1. According to the current algorithm, the scheduler thinks that zone1 don't have scheduled pods, so it will continue to schedule to zone1, resulting in scheduling error
Bug Report
What version of Kubernetes are you using?
Client Version: version.Info{Major:"1", Minor:"16+", GitVersion:"v1.16.6-beta.0", GitCommit:"e7f962ba86f4ce7033828210ca3556393c377bcc", GitTreeState:"clean", BuildDate:"2020-01-15T08:26:26Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"darwin/amd64"} Server Version: version.Info{Major:"1", Minor:"16+", GitVersion:"v1.16.9-49+bb32c46d83322c", GitCommit:"bb32c46d83322cb1c90306f7170444575d43efe1", GitTreeState:"clean", BuildDate:"2020-05-08T03:44:59Z", GoVersion:"go1.13.7", Compiler:"gc", Platform:"linux/amd64"}
What version of TiDB Operator are you using? 1.1
What did you do?
Creating tc, pods in tidb cluster is scheduled based on zone(topologyKey=zone), there are 3 zones and 3 replicas, so, pods should be scheduled in 3 zones.
What did you expect to see? Pods deployed three zones as follows:
xr-hulk-k8s-ep-test206
is in zone xr,gh-hulk-k8s-ep-test465
is in zone gh,zf-hulk-k8s-ep-test400
is in zone zfWhat did you see instead? Pods deployed two zones as follows:
gh-hulk-k8s-ep-test465
andgh-hulk-k8s-ep-test400
are in zone gh,xr-hulk-k8s-ep-test206
is in zone xrFor more information, see the documentation: https://shimo.im/docs/T36g3WghYTTtKDkX