Skip to content

Commit

Permalink
use int to keep consistent with the leader
Browse files Browse the repository at this point in the history
Signed-off-by: Wenbo Zhang <ethercflow@gmail.com>
  • Loading branch information
ethercflow committed Mar 13, 2023
1 parent 7cf8463 commit 3458660
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/schedule/placement/fit.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}

0 comments on commit 3458660

Please sign in to comment.