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
Backport of [VAULT-5003] Use net/http client in Sys().RaftSnapshotRestore into release/1.9.x #14837
Merged
VinnyHC
merged 14 commits into
release/1.9.x
from
backport/vinnyhc/VAULT-5003_retry/seriously-harmless-fowl
Apr 1, 2022
Merged
Backport of [VAULT-5003] Use net/http client in Sys().RaftSnapshotRestore into release/1.9.x #14837
VinnyHC
merged 14 commits into
release/1.9.x
from
backport/vinnyhc/VAULT-5003_retry/seriously-harmless-fowl
Apr 1, 2022
Conversation
This file contains 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
hc-github-team-secure-vault-core
force-pushed
the
backport/vinnyhc/VAULT-5003_retry/seriously-harmless-fowl
branch
from
April 1, 2022 16:37
8684f9a
to
7121ff0
Compare
…eriously-harmless-fowl
averche
approved these changes
Apr 1, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
VinnyHC
deleted the
backport/vinnyhc/VAULT-5003_retry/seriously-harmless-fowl
branch
April 1, 2022 19:55
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.
Backport
This PR is auto-generated from #14269 to be assessed for backporting due to the inclusion of the label backport/1.9.x.
WARNING automatic cherry-pick of commits failed. Commits will require human attention.
The below text is copied from the body of the original PR.
What does this PR do?
Modifies
(*client).Sys().RaftSnapshotRestore
function to use a net/http client to prevent attempting to read the entire body of a request (which is the case in our(*client).RawRequestWithContext()
)The
go-retryablehttp
package makes a copy of the request body on construction of a retry-able request to be able to re-play the request. When large snapshots are streamed to the server, this is problematic for the API client’sSys().RaftSnapshotRestore
function.Any useful background information?
This likely hasn't been identified as a problem in our CLI tool because we use files that
go-retryablehttp
can handle without reading the full value into memory.Our
(*client).Sys().RaftSnapshot
method currently implements a net/http client.How has this been tested?
Tests have been updated to use helper functions.
Analyzed a memory profile of our current code when writing a "large" snapshot, which copies the entire request body, where the new code does not. Large writes have not been included in the updated tests as to not gobble up unnecessary resources.
"large" data object: