Skip to content

Commit

Permalink
fix: Reset cluster scope rate with paramtable values and force update it
Browse files Browse the repository at this point in the history
See also milvus-io#35496

Signed-off-by: Congqi Xia <[email protected]>
  • Loading branch information
congqixia committed Aug 15, 2024
1 parent fe20366 commit 528becf
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions internal/rootcoord/quota_center.go
Original file line number Diff line number Diff line change
Expand Up @@ -1283,7 +1283,8 @@ func (q *QuotaCenter) calculateRates() error {
}

func (q *QuotaCenter) resetAllCurrentRates() error {
q.rateLimiter = rlinternal.NewRateLimiterTree(initInfLimiter(internalpb.RateScope_Cluster, allOps))
q.rateLimiter = rlinternal.NewRateLimiterTree(newParamLimiterFunc(internalpb.RateScope_Cluster, allOps)())

initLimiters := func(sourceCollections map[int64]map[int64][]int64) {
for dbID, collections := range sourceCollections {
for collectionID, partitionIDs := range collections {
Expand Down Expand Up @@ -1469,9 +1470,7 @@ func (q *QuotaCenter) toRequestLimiter(limiter *rlinternal.RateLimiterNode) *pro
return nil
}
limiter.GetLimiters().Range(func(rt internalpb.RateType, limiter *ratelimitutil.Limiter) bool {
if !limiter.HasUpdated() {
return true
}
// limiter.HasUpdated may block rate update when proxy node number changed
r := limiter.Limit()
if r != Inf {
rates = append(rates, &internalpb.Rate{Rt: rt, R: float64(r) / float64(proxyNum)})
Expand Down

0 comments on commit 528becf

Please sign in to comment.