From 34586604ac67e59afdf03a22ddc0fb602e97ac10 Mon Sep 17 00:00:00 2001 From: Wenbo Zhang Date: Mon, 13 Mar 2023 17:45:48 +0800 Subject: [PATCH] use int to keep consistent with the leader Signed-off-by: Wenbo Zhang --- pkg/schedule/placement/fit.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/schedule/placement/fit.go b/pkg/schedule/placement/fit.go index f4ebe7db78e..6e6b20f6c33 100644 --- a/pkg/schedule/placement/fit.go +++ b/pkg/schedule/placement/fit.go @@ -107,7 +107,7 @@ type RuleFit struct { // IsolationScore indicates at which level of labeling these Peers are // isolated. A larger value is better. IsolationScore float64 `json:"isolation-score"` - WitnessScore int64 `json:"witness-score"` + WitnessScore int `json:"witness-score"` // stores is the stores that the peers are placed in. stores []*core.StoreInfo } @@ -435,13 +435,13 @@ func stateScore(region *core.RegionInfo, peerID uint64) int { } } -func witnessScore(peers []*fitPeer, fitWitness bool) int64 { - var score int64 +func witnessScore(peers []*fitPeer, fitWitness bool) int { + var score int if !fitWitness || len(peers) == 0 { return 0 } for _, p := range peers { - score += int64(p.store.GetWitnessCount()) + score += p.store.GetWitnessCount() } return score }