From 982bf3cda3f4737a6c767d042445a2918e4aeadb Mon Sep 17 00:00:00 2001 From: ShuNing Date: Sun, 7 Apr 2024 19:15:19 +0800 Subject: [PATCH] This is an automated cherry-pick of #8028 ref tikv/pd#7509 Signed-off-by: ti-chi-bot --- client/resource_group/controller/limiter.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/client/resource_group/controller/limiter.go b/client/resource_group/controller/limiter.go index e8c50425bdc..0159371b710 100644 --- a/client/resource_group/controller/limiter.go +++ b/client/resource_group/controller/limiter.go @@ -403,6 +403,7 @@ func (lim *Limiter) reserveN(now time.Time, n float64, maxFutureReserve time.Dur lim.tokens = tokens lim.maybeNotify() } else { +<<<<<<< HEAD // print log if the limiter cannot reserve for a while. if time.Since(lim.last) > reserveWarnLogInterval { log.Warn("[resource group controller] cannot reserve enough tokens", @@ -416,6 +417,18 @@ func (lim *Limiter) reserveN(now time.Time, n float64, maxFutureReserve time.Dur zap.Int64("burst", lim.burst), zap.Int("remaining-notify-times", lim.remainingNotifyTimes)) } +======= + log.Warn("[resource group controller] cannot reserve enough tokens", + zap.Duration("need-wait-duration", waitDuration), + zap.Duration("max-wait-duration", maxFutureReserve), + zap.Float64("current-ltb-tokens", lim.tokens), + zap.Float64("current-ltb-rate", float64(lim.limit)), + zap.Float64("request-tokens", n), + zap.Float64("notify-threshold", lim.notifyThreshold), + zap.Bool("is-low-process", lim.isLowProcess), + zap.Int64("burst", lim.burst), + zap.Int("remaining-notify-times", lim.remainingNotifyTimes)) +>>>>>>> cbde63645 (client/controller: add logs and export more information in throttled error (#8028)) lim.last = last if lim.limit == 0 { lim.notify()