fix: reduce peak memory usage when round robin tiebreaker is disabled#23606
Open
ariel-miculas wants to merge 5 commits into
Open
fix: reduce peak memory usage when round robin tiebreaker is disabled#23606ariel-miculas wants to merge 5 commits into
ariel-miculas wants to merge 5 commits into
Conversation
mzabaluev
reviewed
Jul 15, 2026
yonipeleg33
reviewed
Jul 16, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #23606 +/- ##
=======================================
Coverage ? 80.65%
=======================================
Files ? 1086
Lines ? 366107
Branches ? 366107
=======================================
Hits ? 295289
Misses ? 53225
Partials ? 17593 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
yonipeleg33
approved these changes
Jul 16, 2026
Comment on lines
+400
to
+402
| if self.enable_round_robin_tie_breaker { | ||
| self.prev_cursors.as_mut().expect("prev_cursor should be set when round robin tie breaker is enabled")[stream_idx] = taken; | ||
| } |
There was a problem hiding this comment.
The expect() check seems a bit redundant, just match on the option directly
Suggested change
| if self.enable_round_robin_tie_breaker { | |
| self.prev_cursors.as_mut().expect("prev_cursor should be set when round robin tie breaker is enabled")[stream_idx] = taken; | |
| } | |
| if let Some(prev_cursors) = self.prev_cursors.as_mut() { | |
| prev_cursors[stream_idx] = taken; | |
| } |
Contributor
Author
There was a problem hiding this comment.
this would silently break if for some reason a None would end up in prev_cursors, I prefer to fail loudly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Rationale for this change
Don't pay the memory price when the tie breaking feature is disabled.
What changes are included in this PR?
Mostly tests to show the issue
Are these changes tested?
Yes
Are there any user-facing changes?
No