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

core: adjust capacity to fit for more cases #1035

Merged
merged 5 commits into from
Apr 20, 2018

Conversation

Connor1996
Copy link
Member

@Connor1996 Connor1996 commented Apr 19, 2018

if tikv uses whole storage capacity as capacity, it is probably available ratio is too small cause there are so many other irrelative files in the storage, namely, capacity == available + used + irrelative . So pd need take it into consideration.

@Connor1996 Connor1996 changed the title core: adjust capacity core: adjust capacity to fit more cases Apr 19, 2018
@Connor1996 Connor1996 changed the title core: adjust capacity to fit more cases core: adjust capacity to fit for more cases Apr 19, 2018
@@ -114,16 +114,16 @@ func (s *StoreInfo) LeaderScore(delta int64) float64 {
// RegionScore returns the store's region score.
func (s *StoreInfo) RegionScore(highSpaceRatio, lowSpaceRatio float64, delta int64) float64 {
if s.RegionSize == 0 {
return float64(delta)
return float64(delta) / math.Max(s.RegionWeight, minWeight)
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 ok to return a negative score?

Copy link
Member Author

Choose a reason for hiding this comment

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

when region size == 0, the store must selected as target, so the delta must larger than 0

Copy link
Contributor

@disksing disksing left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Contributor

@nolouch nolouch left a comment

Choose a reason for hiding this comment

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

LGTM

@disksing
Copy link
Contributor

LGTM.

@Connor1996 Connor1996 merged commit 5d700a5 into tikv:master Apr 20, 2018
@Connor1996 Connor1996 deleted the capacity branch April 20, 2018 03:31
disksing pushed a commit to oh-my-tidb/pd that referenced this pull request May 7, 2018
disksing added a commit that referenced this pull request May 8, 2018
* server: skip check a region if there is already a pending operator. (#1029)

* pdctl, api, schedule: pdctl supports scatter region. (#1028)

* add change log (#1024)

* scheduler: hot write scheduler randomly select the balance strategy (#1034)

* *: new store region score function for balance (#1014)

* core: adjust capacity to fit for more cases (#1035)

* check config validation (#1036)

* *: add metrics for hotspot cache (#1027)

* Refine install instructions. (#1041)

These extra steps can help new users who are perhaps not quite so familiar with Go setup and conventions.

* *: add change log for 2.0 GA (#1038)

* *: add change log for ga.

* scheduler: adjust metrics (#1042)

* fix parse error of config.toml (#1043)

* server: resign pd leader when it is not same as etcd leader. (#1039)

* server: fix the valid scheduler was deleted when start coordinator (#1045)

* server: fix the valid scheduler was deleted when start coordinator
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.

3 participants