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

Can't schedule 4 TiKV instances on 3 K8s nodes #652

Closed
weekface opened this issue Jul 11, 2019 · 1 comment · Fixed by #670
Closed

Can't schedule 4 TiKV instances on 3 K8s nodes #652

weekface opened this issue Jul 11, 2019 · 1 comment · Fixed by #670
Labels
enhancement New feature or request
Milestone

Comments

@weekface
Copy link
Contributor

We have a new algorithm here, there is a corner that we can't schedule 4 tikv instances on a 3 k8s nodes.

if podsCount+1 >= int(replicas+1)/2 {
continue
}

{
name: "three nodes, three pods scheduled on these three nodes, replicas is 4, can't scheduled",
podFn: newHAPDPod,
nodesFn: fakeThreeNodes,
podListFn: podListFn(map[string][]int32{"kube-node-1": {0}, "kube-node-2": {1}, "kube-node-3": {2}}),
acquireLockFn: acquireSuccess,
tcGetFn: func(ns string, tcName string) (*v1alpha1.TidbCluster, error) {
tc, _ := tcGetFn(ns, tcName)
tc.Spec.PD.Replicas = 4
return tc, nil
},
expectFn: func(nodes []apiv1.Node, err error, recorder record.FakeRecorder) {
g.Expect(err).To(HaveOccurred())
events := collectEvents(recorder.Events)
g.Expect(events).To(HaveLen(1))
g.Expect(events[0]).To(ContainSubstring("FailedScheduling"))
g.Expect(strings.Contains(err.Error(), "can't schedule to nodes:")).To(BeTrue())
g.Expect(len(nodes)).To(Equal(0))
},
},

@weekface weekface added the enhancement New feature or request label Jul 15, 2019
@weekface weekface added this to the v1.1 milestone Jul 16, 2019
@cofyc
Copy link
Contributor

cofyc commented Jul 18, 2019

what's the expected behavior of HA algorithm?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants