tikv / tikv/pd

scheduler: region score are different between log and metrics

Open
#5,570 4 comments 0 reactions 1 assignee Assigned to @lhy1024 View on GitHub
may-affects-4.0 may-affects-5.0 may-affects-5.1 may-affects-5.2 may-affects-5.3 may-affects-5.4 may-affects-6.0 may-affects-6.1 may-affects-6.2 may-affects-6.3 severity/moderate type/bug
Dominant language
Go
Stars
1.2k
Forks
783
Avg merge
5d 21h
Merged PRs (30d)
36

Description

## Bug Report

### What did you do?

add a new node

### What did you expect to see?

the cluster is balance

### What did you see instead?

the cluster is no balance and their region score differ a lot, but pd doesn't create operator.

![image](https://user-images.githubusercontent.com/19542290/193277191-38952b27-ea5f-4ca5-9f6d-ec6d88d780f3.png)

but log is different with metrics
`[2022/09/30 06:54:42.576 +00:00] [DEBUG] [utils.go:124] ["skip balance region"] [scheduler=balance-region-scheduler] [region-id=193894476] [source-store=115121122] [target-store=717892230] [source-size=3230518] [source-score=3590635.5235656626] [source-influence=0] [target-size=68663] [target-score=1193743611.955962] [target-influence=0] [average-region-size=73] [tolerant-resource=16028]`

Because, the score of metrics is `RegionScore(s.opt.GetRegionScoreFormulaVersion(), s.opt.GetHighSpaceRatio(), s.opt.GetLowSpaceRatio(), 0)`
the score of log is `RegionScore(opts.GetRegionScoreFormulaVersion(), opts.GetHighSpaceRatio(), opts.GetLowSpaceRatio(), targetDelta)`

this makes us cannot know why pd doesn't create operator by metrics.

### What version of PD are you using (`pd-server -V`)?
master

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.