Skip to content
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

Limit Gcs.Write to single storage.create api call #1238

Merged
merged 1 commit into from
Apr 9, 2020
Merged

Conversation

relud
Copy link
Contributor

@relud relud commented Apr 9, 2020

to remove any chance of partial write complications and minimize the number of api calls.

requires #1237 to prevent data loss by ensuring that content.write is never called after content.toByteArray()

@relud relud requested a review from jklukas April 9, 2020 00:28
Copy link
Contributor

@jklukas jklukas left a comment

Choose a reason for hiding this comment

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

Am I correct with context here that you've determined the GCS SDK is not releasing memory as we make .write calls, so there's no memory benefit to incrementally pushing data into the SDK, so we might as well do the simpler thing of accumulating a byte stream and flushing it to GCS all at once?

@relud
Copy link
Contributor Author

relud commented Apr 9, 2020

Am I correct with context here that you've determined the GCS SDK is not releasing memory as we make .write calls, so there's no memory benefit to incrementally pushing data into the SDK, so we might as well do the simpler thing of accumulating a byte stream and flushing it to GCS all at once?

yes, but the reason is that with BATCH_MAX_DELAY=10s the sum of in-flight batches is at most around 30MiB uncompressed (not counting any copies lingering from concatenating byte strings).

@relud relud merged commit a496d35 into master Apr 9, 2020
@relud relud deleted the gcs-use-create branch April 9, 2020 22:25
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