Skip to content

Commit

Permalink
schedule: avoid redundant schedule in small cluster
Browse files Browse the repository at this point in the history
Signed-off-by: lhy1024 <admin@liudos.us>
  • Loading branch information
lhy1024 committed Jan 10, 2025
1 parent 31a0ad6 commit 1f53f12
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/schedule/schedulers/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ func (p *solver) getTolerantResource() int64 {
p.tolerantSource = int64(p.tolerantSizeRatio)
} else {
regionSize := p.GetAverageRegionSize()
minRegionSize := int64(p.GetSchedulerConfig().GetScheduleConfig().MaxMergeRegionSize)
if regionSize < minRegionSize {
regionSize = minRegionSize
}
p.tolerantSource = int64(float64(regionSize) * p.tolerantSizeRatio)
}
return p.tolerantSource
Expand Down

0 comments on commit 1f53f12

Please sign in to comment.