Skip to content

Optimize GCS Repo Uploads#51596

Merged
original-brownbear merged 2 commits intoelastic:masterfrom
original-brownbear:optimize-gcs-small-uploads
Jan 29, 2020
Merged

Optimize GCS Repo Uploads#51596
original-brownbear merged 2 commits intoelastic:masterfrom
original-brownbear:optimize-gcs-small-uploads

Conversation

@original-brownbear
Copy link
Copy Markdown
Contributor

@original-brownbear original-brownbear commented Jan 29, 2020

For small uploads (that can still be up to 5MB!) we needlessly
reading the InputStream into a BAOS which entailed allocating
the byte[] for the stream contents twice (because to toByteArray on the BAOS copies).

Also, for resumeable uploads we were needlessly wrapping the output channel and running each individual write in its own privileged context when we could just wrap the whole upload in a single privileged context.

Relates #51593

For small uploads (that can still be up to 5MB!) we needlessly
reading the `InputStream` into a BAOS which entailed allocating
the `byte[]` for the stream contents twice (because to `toByteArray` on the BAOS copies).

Relates #51593
@original-brownbear original-brownbear added >non-issue :Distributed/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs v8.0.0 v7.7.0 labels Jan 29, 2020
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-distributed (:Distributed/Snapshot/Restore)

Copy link
Copy Markdown
Member

@tlrx tlrx left a comment

Choose a reason for hiding this comment

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

LGTM, thanks Armin

@original-brownbear
Copy link
Copy Markdown
Contributor Author

Np + thanks Tanguy!

@original-brownbear original-brownbear merged commit 06c5db2 into elastic:master Jan 29, 2020
@original-brownbear original-brownbear deleted the optimize-gcs-small-uploads branch January 29, 2020 14:03
original-brownbear added a commit that referenced this pull request Jan 29, 2020
For small uploads (that can still be up to 5MB!) we needlessly
reading the `InputStream` into a BAOS which entailed allocating
the `byte[]` for the stream contents twice (because to `toByteArray` on the BAOS copies).

Also, for resumeable uploads we were needlessly wrapping the output channel and running each individual write in its own privileged context when we could just wrap the whole upload in a single privileged context.

Relates #51593
@original-brownbear original-brownbear restored the optimize-gcs-small-uploads branch August 6, 2020 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Distributed/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs >non-issue v7.7.0 v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants