Skip to content

Commit

Permalink
changefeedccl: Ensure throttler is no-op when disabled
Browse files Browse the repository at this point in the history
Use `quotapool.Inf()` as the throttle limit
instead of max int64 to ensure that when throttler
is desabled, attempts to acquire quota are roughly free.

Epic: None

Release note: None
  • Loading branch information
Yevgeniy Miretskiy committed Sep 8, 2023
1 parent ace4f86 commit 41ab30f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/ccl/changefeedccl/cdcutils/throttle.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"context"
"encoding/json"
"fmt"
"math"
"sync"
"time"

Expand Down Expand Up @@ -69,7 +68,7 @@ func (t *Throttler) AcquireFlushQuota(ctx context.Context) error {
func (t *Throttler) updateConfig(config changefeedbase.SinkThrottleConfig) {
setLimits := func(rl *quotapool.RateLimiter, rate, burst float64) {
// set rateBudget to unlimited if rate is 0.
rateBudget := quotapool.Limit(math.MaxInt64)
rateBudget := quotapool.Inf()
if rate > 0 {
rateBudget = quotapool.Limit(rate)
}
Expand Down

0 comments on commit 41ab30f

Please sign in to comment.