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

new algorithm for scheduler HA predicate #260

Merged
merged 7 commits into from
Jan 11, 2019

Conversation

weekface
Copy link
Contributor

@weekface weekface commented Jan 4, 2019

@weekface
Copy link
Contributor Author

weekface commented Jan 4, 2019

/run-e2e-tests

@weekface
Copy link
Contributor Author

weekface commented Jan 4, 2019

/run-e2e-tests

},
},
{
name: "one pod, podName is wrong",
ordinal: 0,
name: "one node, return zero node",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
name: "one node, return zero node",
name: "zero node, return zero node",

Copy link
Contributor

@xiaojingchen xiaojingchen left a comment

Choose a reason for hiding this comment

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

LGTM

Co-Authored-By: weekface <weekface@gmail.com>
if !minInitialized {
minInitialized = true
min = count
min := -1
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 better to initialize the min variable to a large enough value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Large enough, how big is it?

Copy link
Contributor

Choose a reason for hiding this comment

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

The default number of pods that can be run on a kubelet is 110, so I think it's okay to be larger than this number, what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This number may be modified by the user. -1 is good enough i think.

@weekface
Copy link
Contributor Author

weekface commented Jan 8, 2019

/run-e2e-tests

@@ -39,229 +40,327 @@ func TestMapNil(t *testing.T) {

g.Expect(m["c"] == nil).To(Equal(true))
g.Expect(m["a"] == nil).To(Equal(false))

var i *int
g.Expect(i).To(BeNil())
Copy link
Member

Choose a reason for hiding this comment

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

What is this?

g.Expect(i).To(BeNil())
}

func TestSortEmptyArr(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

What's the purpose of this test?

@weekface
Copy link
Contributor Author

/run-e2e-tests

Copy link
Member

@tennix tennix left a comment

Choose a reason for hiding this comment

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

LGTM

@weekface weekface merged commit d1f9804 into pingcap:master Jan 11, 2019
@weekface weekface deleted the new-scheduler-ha branch January 11, 2019 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A new algorithm for tidb scheduler HA predicate
4 participants