Skip to content

Commit

Permalink
minor update
Browse files Browse the repository at this point in the history
Signed-off-by: disksing <i@disksing.com>
  • Loading branch information
disksing committed Dec 14, 2020
1 parent 082cb66 commit 186cc85
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/core/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,11 @@ func (s *StoreInfo) regionScoreV2(delta int64, deviation int) float64 {
if A >= C || C < 1 {
score = R
} else if A > F {
// As the amount of data increases (available becomes smaller), the weight of region size on total score
// increases. Ideally, all nodes converge at the position where remaining space is F (default 20GiB).
score = (K + M*(math.Log(C)-math.Log(A-F+1))/(C-A+F-1)) * R
} else {
// When remaining space is less then F, the score is mainly determined by available space.
score = (K+M*math.Log(C)/C)*R + (F-A)*(K+M*math.Log(F)/F)
}
return score / math.Max(s.GetRegionWeight(), minWeight)
Expand Down

0 comments on commit 186cc85

Please sign in to comment.