From 50649b6f7fe3df1aa6e5447bf5793258e6a3438c Mon Sep 17 00:00:00 2001 From: Tobias Grieger Date: Thu, 19 May 2022 22:08:41 +0200 Subject: [PATCH] admission: avoid spurious logging when not in IO overload I broke this in https://github.com/cockroachdb/cockroach/pull/80859. Release note: None --- pkg/util/admission/granter.go | 1 + pkg/util/admission/testdata/io_load_listener | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/util/admission/granter.go b/pkg/util/admission/granter.go index 7a955c6c4c29..7118806fa7b4 100644 --- a/pkg/util/admission/granter.go +++ b/pkg/util/admission/granter.go @@ -1909,6 +1909,7 @@ func (*ioLoadListener) adjustTokensInner( numTokens := intL0CompactedBytes smoothedTotalNumByteTokens = alpha*float64(numTokens) + (1-alpha)*prev.smoothedTotalNumByteTokens totalNumByteTokens = unlimitedTokens + doLog = false } // Install the latest cumulative stats. return adjustTokensResult{ diff --git a/pkg/util/admission/testdata/io_load_listener b/pkg/util/admission/testdata/io_load_listener index c618c117dc4e..853c24cb09af 100644 --- a/pkg/util/admission/testdata/io_load_listener +++ b/pkg/util/admission/testdata/io_load_listener @@ -115,7 +115,7 @@ prep-admission-stats admitted=30000 set-state l0-bytes=10000 l0-added=501000 l0-files=21 l0-sublevels=20 ---- 21 ssts, 20 sub-levels, L0 growth 293 KiB: 0 B acc-write + 0 B acc-ingest + 293 KiB unacc [≈20 B/req, n=10000], compacted 293 KiB [≈165 KiB]; admitting all -{ioLoadListenerState:{cumAdmissionStats:{admittedCount:30000 admittedWithBytesCount:0 admittedAccountedBytes:0 ingestedAccountedBytes:0 ingestedAccountedL0Bytes:0} cumL0AddedBytes:501000 curL0Bytes:10000 smoothedIntL0CompactedBytes:168750 smoothedIntPerWorkUnaccountedL0Bytes:20 smoothedIntIngestedAccountedL0BytesFraction:0.5 smoothedTotalNumByteTokens:160937.5 totalNumByteTokens:9223372036854775807 tokensAllocated:0} requestEstimates:{fractionOfIngestIntoL0:0.5 workByteAddition:20} aux:{shouldLog:true curL0NumFiles:21 curL0NumSublevels:20 intL0AddedBytes:300000 intL0CompactedBytes:300000 intAdmittedCount:10000 intAdmittedBytes:0 intIngestedBytes:0 intIngestedAccountedL0Bytes:0 intAccountedL0Bytes:0 intUnaccountedL0Bytes:300000 intPerWorkUnaccountedL0Bytes:30 l0BytesIngestFraction:0}} +{ioLoadListenerState:{cumAdmissionStats:{admittedCount:30000 admittedWithBytesCount:0 admittedAccountedBytes:0 ingestedAccountedBytes:0 ingestedAccountedL0Bytes:0} cumL0AddedBytes:501000 curL0Bytes:10000 smoothedIntL0CompactedBytes:168750 smoothedIntPerWorkUnaccountedL0Bytes:20 smoothedIntIngestedAccountedL0BytesFraction:0.5 smoothedTotalNumByteTokens:160937.5 totalNumByteTokens:9223372036854775807 tokensAllocated:0} requestEstimates:{fractionOfIngestIntoL0:0.5 workByteAddition:20} aux:{shouldLog:false curL0NumFiles:21 curL0NumSublevels:20 intL0AddedBytes:300000 intL0CompactedBytes:300000 intAdmittedCount:10000 intAdmittedBytes:0 intIngestedBytes:0 intIngestedAccountedL0Bytes:0 intAccountedL0Bytes:0 intUnaccountedL0Bytes:300000 intPerWorkUnaccountedL0Bytes:30 l0BytesIngestFraction:0}} store-request-estimates: fractionOfIngestIntoL0: 0.50, workByteAddition: 20 tick: 0, setAvailableIOTokens: unlimited tick: 1, setAvailableIOTokens: unlimited