Skip to content

fix: [branch-0.14] backport #3914 - use min instead of max when capping write buffer size to Int range#3936

Merged
andygrove merged 1 commit intoapache:branch-0.14from
andygrove:backport-3914-to-0.14
Apr 14, 2026
Merged

fix: [branch-0.14] backport #3914 - use min instead of max when capping write buffer size to Int range#3936
andygrove merged 1 commit intoapache:branch-0.14from
andygrove:backport-3914-to-0.14

Conversation

@andygrove
Copy link
Copy Markdown
Member

@andygrove andygrove commented Apr 13, 2026

Which issue does this PR close?

Backport of #3914 to branch-0.14.

Rationale for this change

PR #3914 fixes a bug where max was used instead of min when capping the write buffer size to the Int range.

What changes are included in this PR?

Cherry-pick of commit 967a81e from main. A one-line fix changing max to min when capping the write buffer size.

How are these changes tested?

Covered by existing tests in the original PR.

…ge (apache#3914)

COMET_SHUFFLE_WRITE_BUFFER_SIZE is a Long (bytesConf) but the protobuf
field is int32, so the value must be capped at Int.MaxValue. The code
used .max(Int.MaxValue) which always returns Int.MaxValue (~2GB)
regardless of the configured value. Should be .min(Int.MaxValue) to
preserve smaller values while capping at the Int range.
@andygrove andygrove changed the title fix: backport #3914 - use min instead of max when capping write buffer size to Int range fix: [branch-0.14] backport #3914 - use min instead of max when capping write buffer size to Int range Apr 13, 2026
Copy link
Copy Markdown
Contributor

@mbutrovich mbutrovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @andygrove!

@andygrove andygrove merged commit 3a730de into apache:branch-0.14 Apr 14, 2026
190 of 194 checks passed
@andygrove andygrove deleted the backport-3914-to-0.14 branch April 14, 2026 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants