From efdce464f5001f29a3a07bf23bcbc4769443ff18 Mon Sep 17 00:00:00 2001 From: bigsheeper Date: Thu, 13 Oct 2022 16:15:25 +0800 Subject: [PATCH] Fix ttProtection.enabled and memProtection (#19756) Signed-off-by: bigsheeper Signed-off-by: bigsheeper --- internal/rootcoord/quota_center.go | 2 +- internal/util/paramtable/quota_param.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/rootcoord/quota_center.go b/internal/rootcoord/quota_center.go index d6c854e34c..30d6df0c8c 100644 --- a/internal/rootcoord/quota_center.go +++ b/internal/rootcoord/quota_center.go @@ -349,7 +349,7 @@ func (q *QuotaCenter) calculateWriteRates() error { log.Debug("QuotaCenter check timeTickDelay done", zap.Float64("ttFactor", ttFactor)) memFactor := q.memoryToWaterLevel() - if ttFactor <= 0 { + if memFactor <= 0 { q.forceDenyWriting(MemoryExhausted) // memory protection return nil } diff --git a/internal/util/paramtable/quota_param.go b/internal/util/paramtable/quota_param.go index 6b76301d44..754d842fc3 100644 --- a/internal/util/paramtable/quota_param.go +++ b/internal/util/paramtable/quota_param.go @@ -432,7 +432,7 @@ func (p *quotaConfig) initForceDenyWriting() { } func (p *quotaConfig) initTtProtectionEnabled() { - p.TtProtectionEnabled = p.Base.ParseBool("quotaAndLimits.limitWriting.ttProtection", true) + p.TtProtectionEnabled = p.Base.ParseBool("quotaAndLimits.limitWriting.ttProtection.enabled", true) } func (p *quotaConfig) initMaxTimeTickDelay() {