fix: Don't use a reader with seeking support when no_rotate is true#18608
Merged
Conversation
marianogappa
approved these changes
Jul 18, 2024
kodiakhq Bot
pushed a commit
that referenced
this pull request
Jul 19, 2024
🤖 I have created a release *beep* *boop* --- ## [7.3.1](plugins-destination-s3-v7.3.0...plugins-destination-s3-v7.3.1) (2024-07-18) ### Bug Fixes * Don't use a reader with seeking support when `no_rotate` is true ([#18608](#18608)) ([b5e06d3](b5e06d3)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
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.
Summary
Follow up to #18361.
When
no_rotate: truewe can get large files to upload and when that happens we'll be holding the whole file in memory and eventually running out of it.An example is a sync on many AWS accounts (for example 2000), even for a single table. Let's say the table data is 10MB per account, we end up with a file of 20GB.
The downside of this change is that if a sync has a single account but many tables (and
no_rotate: true), we'll run into the same issue #18361 fixed.There are workarounds for both issues (either reducing the number of accounts in the sync, or reducing the concurrency).
The best solution would be to get aws/aws-sdk-go-v2#2694 fixed (suggested solution in https://github.com/aws/aws-sdk-go-v2/compare/main...erezrokah:fix/dont_over_allocate_small_files?expand=1), but doesn't seems like it's going to happen soon.