Skip to content

Optimize GCS Repo Uploads (#51596)#51618

Merged
original-brownbear merged 1 commit intoelastic:7.xfrom
original-brownbear:51596-7.x
Jan 29, 2020
Merged

Optimize GCS Repo Uploads (#51596)#51618
original-brownbear merged 1 commit intoelastic:7.xfrom
original-brownbear:51596-7.x

Conversation

@original-brownbear
Copy link
Copy Markdown
Contributor

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

backport of #51596

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 added :Distributed/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs backport labels Jan 29, 2020
@elasticmachine
Copy link
Copy Markdown
Collaborator

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

@original-brownbear original-brownbear merged commit 74e3694 into elastic:7.x Jan 29, 2020
@original-brownbear original-brownbear deleted the 51596-7.x branch January 29, 2020 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport :Distributed/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants