-
Notifications
You must be signed in to change notification settings - Fork 755
Closed
Labels
affects-6.1This bug affects the 6.1.x(LTS) versions.This bug affects the 6.1.x(LTS) versions.affects-6.5This bug affects the 6.5.x(LTS) versions.This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.This bug affects the 7.1.x(LTS) versions.severity/minortype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.
Description
Bug Report
Right now, the scatter region consists of two parts: peer and leader. But the behavior is different. The scatter peer is according to the count of all groups, however, the scatter leader will use the count of a single group. It might cause the leader to be not balanced due to the wrong usage of TiDB. See pingcap/tidb#46135.
pd/pkg/schedule/scatter/region_scatterer.go
Lines 453 to 461 in 70e9ffc
| for _, store := range stores { | |
| count := context.selectedPeer.TotalCountByStore(store.GetID()) | |
| if count > maxStoreTotalCount { | |
| maxStoreTotalCount = count | |
| } | |
| if count < minStoreTotalCount { | |
| minStoreTotalCount = count | |
| } | |
| } |
pd/pkg/schedule/scatter/region_scatterer.go
Lines 514 to 524 in 70e9ffc
| for _, storeID := range leaderCandidateStores { | |
| store := r.cluster.GetStore(storeID) | |
| if store == nil { | |
| continue | |
| } | |
| storeGroupLeaderCount := context.selectedLeader.Get(storeID, group) | |
| if minStoreGroupLeader > storeGroupLeaderCount { | |
| minStoreGroupLeader = storeGroupLeaderCount | |
| id = storeID | |
| } | |
| } |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
affects-6.1This bug affects the 6.1.x(LTS) versions.This bug affects the 6.1.x(LTS) versions.affects-6.5This bug affects the 6.5.x(LTS) versions.This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.This bug affects the 7.1.x(LTS) versions.severity/minortype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.
Type
Projects
Status
Closed