fix: Don't use a reader with seeking support when no_rotate
is true
#18608
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: true
we 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.