Limit the frequency of debug logs ()

Signed-off-by: yah01 <yang.cen@zilliz.com>
pull/25024/head
yah01 2023-06-20 14:14:41 +08:00 committed by GitHub
parent e3b4e77915
commit e962a8ba31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions
internal/querycoordv2/checkers

View File

@ -100,14 +100,14 @@ func (b *BalanceChecker) replicasToBalance() []int64 {
//iterator one normal collection in one round //iterator one normal collection in one round
normalReplicasToBalance := make([]int64, 0) normalReplicasToBalance := make([]int64, 0)
hasUnBalancedCollections := false hasUnbalancedCollection := false
for _, cid := range loadedCollections { for _, cid := range loadedCollections {
if b.normalBalanceCollectionsCurrentRound.Contain(cid) { if b.normalBalanceCollectionsCurrentRound.Contain(cid) {
log.Debug("ScoreBasedBalancer has balanced collection, skip balancing in this round", log.Debug("ScoreBasedBalancer has balanced collection, skip balancing in this round",
zap.Int64("collectionID", cid)) zap.Int64("collectionID", cid))
continue continue
} }
hasUnBalancedCollections = true hasUnbalancedCollection = true
b.normalBalanceCollectionsCurrentRound.Insert(cid) b.normalBalanceCollectionsCurrentRound.Insert(cid)
for _, replica := range b.meta.ReplicaManager.GetByCollection(cid) { for _, replica := range b.meta.ReplicaManager.GetByCollection(cid) {
normalReplicasToBalance = append(normalReplicasToBalance, replica.GetID()) normalReplicasToBalance = append(normalReplicasToBalance, replica.GetID())
@ -115,9 +115,9 @@ func (b *BalanceChecker) replicasToBalance() []int64 {
break break
} }
if !hasUnBalancedCollections { if !hasUnbalancedCollection {
b.normalBalanceCollectionsCurrentRound.Clear() 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") "collections in one round, clear collectionIDs for this round")
} }
return normalReplicasToBalance return normalReplicasToBalance