From e962a8ba31f83f109c64484544d0e2bc358e48d4 Mon Sep 17 00:00:00 2001 From: yah01 Date: Tue, 20 Jun 2023 14:14:41 +0800 Subject: [PATCH] Limit the frequency of debug logs (#25009) Signed-off-by: yah01 --- internal/querycoordv2/checkers/balance_checker.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/querycoordv2/checkers/balance_checker.go b/internal/querycoordv2/checkers/balance_checker.go index ee58ec7d42..39953cbebc 100644 --- a/internal/querycoordv2/checkers/balance_checker.go +++ b/internal/querycoordv2/checkers/balance_checker.go @@ -100,14 +100,14 @@ func (b *BalanceChecker) replicasToBalance() []int64 { //iterator one normal collection in one round normalReplicasToBalance := make([]int64, 0) - hasUnBalancedCollections := false + hasUnbalancedCollection := false for _, cid := range loadedCollections { if b.normalBalanceCollectionsCurrentRound.Contain(cid) { log.Debug("ScoreBasedBalancer has balanced collection, skip balancing in this round", zap.Int64("collectionID", cid)) continue } - hasUnBalancedCollections = true + hasUnbalancedCollection = true b.normalBalanceCollectionsCurrentRound.Insert(cid) for _, replica := range b.meta.ReplicaManager.GetByCollection(cid) { normalReplicasToBalance = append(normalReplicasToBalance, replica.GetID()) @@ -115,9 +115,9 @@ func (b *BalanceChecker) replicasToBalance() []int64 { break } - if !hasUnBalancedCollections { + if !hasUnbalancedCollection { b.normalBalanceCollectionsCurrentRound.Clear() - log.Debug("ScoreBasedBalancer has balanced all " + + log.RatedDebug(10, "ScoreBasedBalancer has balanced all "+ "collections in one round, clear collectionIDs for this round") } return normalReplicasToBalance