Skip to content

Commit

Permalink
Merge pull request #136925 from cockroachdb/blathers/backport-release…
Browse files Browse the repository at this point in the history
…-24.3-136907

release-24.3: rowinfra: clamp default-batch-bytes-limit under duress
  • Loading branch information
yuzefovich authored Dec 6, 2024
2 parents d8f5d05 + 755def1 commit 68545f8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pkg/sql/rowinfra/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ const ProductionKVBatchSize KeyLimit = 100000

// defaultBatchBytesLimit is the maximum number of bytes a scan request can
// return.
var defaultBatchBytesLimit = BytesLimit(skip.ClampMetamorphicConstantUnderStress(
var defaultBatchBytesLimit = BytesLimit(skip.ClampMetamorphicConstantUnderDuress(
metamorphic.ConstantWithTestRange(
"default-batch-bytes-limit",
defaultBatchBytesLimitProductionValue, /* defaultValue */
1, /* min */
64<<10, /* max, 64KiB */
),
1<<10, /* min, 1KiB */
10<<10, /* min, 10KiB */
))

const defaultBatchBytesLimitProductionValue = 10 << 20 /* 10MiB */
Expand Down
8 changes: 4 additions & 4 deletions pkg/testutils/skip/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

package skip

// ClampMetamorphicConstantUnderStress ensures that the given integer constant
// ClampMetamorphicConstantUnderDuress ensures that the given integer constant
// with metamorphic testing range is at least the given minimum value, when the
// process is running under stress.
func ClampMetamorphicConstantUnderStress(val, min int) int {
if Stress() && val < min {
// process is running under duress.
func ClampMetamorphicConstantUnderDuress(val, min int) int {
if Duress() && val < min {
return min
}
return val
Expand Down

0 comments on commit 68545f8

Please sign in to comment.