tikv / tikv/pd

The correction of influence is a bit excessive in`shouldBalance`

Open
#5,092 1 comment 0 reactions 0 assignees View on GitHub
type/enhancement
Dominant language
Go
Stars
1.2k
Forks
783
Avg merge
5d 21h
Merged PRs (30d)
36

Description

## Enhancement Task
If there is some move-peer operator which is from A->B, B's influence will increase. So PD will try to move peers from B to C.
But we don't want to balance around. So following code is useful.
https://github.com/tikv/pd/blob/d7435da069ab96b91b9e6a6686a394cce6f42390/server/schedulers/utils.go#L91-L97

ps: I think the comments here should be clearer

But I think changing positive value into negative value is a bit excessive. Consider the following scenario
> [Score] A,B,C = 5,3,1
> [Schedule] A->B, A->C
> [Score with influence] A,B,C = 3,4,2
> [want to Schedule] B->C
> [Score in `shouldBalance`] A,B,C = 3,2,2

So we can't move peer from B to C.
IMO, we can change positive value into zero

Contributor guide

Open the contributing guide

Research direction

Start in server/schedulers/utils.go at the linked shouldBalance code around lines 91-97 and trace how influence changes the scores. Reproduce the A→B and A→C scenario from the issue, then verify that positive influence is treated as zero for balancing and clarify the nearby comments.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
distributed-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.