-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VStreamer: For larger compressed transaction payloads, stream the internal contents #17239
Open
mattlord
wants to merge
5
commits into
vitessio:main
Choose a base branch
from
planetscale:vstream_stream_large_cmp_trx_payload_contents
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
VStreamer: For larger compressed transaction payloads, stream the internal contents #17239
mattlord
wants to merge
5
commits into
vitessio:main
from
planetscale:vstream_stream_large_cmp_trx_payload_contents
Conversation
This file contains 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
For larger payloads (> ZstdInMemoryDecompressorMaxSize) we were already streaming the internal events as we decompressed the payload, but in the vstreamer we were still reading the entire contents into memory before sending them to the consumer (vplayer). With this we stream the internal contents all the way from the binlog consumer to the vstream consumer so that we do not need to hold the entire contents, which can be 10s of GiBs, in memory all at once. Signed-off-by: Matt Lord <[email protected]>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
vitess-bot
bot
added
NeedsBackportReason
If backport labels have been applied to a PR, a justification is required
NeedsDescriptionUpdate
The description is not clear or comprehensive enough, and needs work
NeedsIssue
A linked issue is missing for this Pull Request
NeedsWebsiteDocsUpdate
What it says
labels
Nov 15, 2024
mattlord
changed the title
For larger payloads, stream the internal contents
VStreamer: For larger payloads, stream the internal contents
Nov 15, 2024
mattlord
changed the title
VStreamer: For larger payloads, stream the internal contents
VStreamer: For larger compressed transaction payloads, stream the internal contents
Nov 15, 2024
mattlord
removed
the
NeedsBackportReason
If backport labels have been applied to a PR, a justification is required
label
Nov 15, 2024
Signed-off-by: Matt Lord <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #17239 +/- ##
=======================================
Coverage 67.39% 67.39%
=======================================
Files 1570 1570
Lines 252917 252937 +20
=======================================
+ Hits 170446 170460 +14
- Misses 82471 82477 +6 ☔ View full report in Codecov by Sentry. |
mattlord
removed
NeedsDescriptionUpdate
The description is not clear or comprehensive enough, and needs work
NeedsWebsiteDocsUpdate
What it says
NeedsIssue
A linked issue is missing for this Pull Request
labels
Nov 15, 2024
Signed-off-by: Matt Lord <[email protected]>
Signed-off-by: Matt Lord <[email protected]>
mattlord
requested review from
harshit-gangal,
systay,
shlomi-noach,
rohit-nayak-ps and
timvaillancourt
as code owners
November 16, 2024 03:39
mattlord
requested review from
derekperkins and
arthurschreiber
and removed request for
systay,
timvaillancourt and
harshit-gangal
November 16, 2024 03:40
…cmp_trx_payload_contents Signed-off-by: Matt Lord <[email protected]>
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.
Description
For larger compressed transaction payloads (> ZstdInMemoryDecompressorMaxSize) we were already streaming the internal events as we decompressed the payload, but in the vstreamer we were still reading the entire contents into memory before sending them to the consumer (vplayer).
In this PR, we stream the internal contents all the way from the binlog consumer to the vstream consumer so that we do not need to hold the entire contents, which can be 10s or even 100s of GiBs, in memory all at once. As you can see in the test/demonstration below, we allocate and use DRASTICALLY less memory when processing the payloads: in this case approximately 14-18 times less.
Here's a manual test/demonstration on macOS (note that we end up with over 40 million rows in the customer table):
Results on the PR branch:
Results on the main branch:
Related Issue(s)
Checklist