-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[VAULT-5003] Use net/http client in Sys().RaftSnapshotRestore #14269
Merged
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
VinnyHC
force-pushed
the
vinnyhc/VAULT-5003_retry
branch
from
February 25, 2022 00:11
fc08616
to
73fc27b
Compare
averche
reviewed
Feb 25, 2022
averche
reviewed
Feb 25, 2022
VinnyHC
force-pushed
the
vinnyhc/VAULT-5003_retry
branch
from
February 25, 2022 18:18
9b5a79c
to
09b26e4
Compare
VinnyHC
force-pushed
the
vinnyhc/VAULT-5003_retry
branch
from
February 25, 2022 18:38
09b26e4
to
780782e
Compare
VinnyHC
changed the title
(WIP) [VAULT-5003] Use net/http client in Sys().RaftSnapshotRestore
[VAULT-5003] Use net/http client in Sys().RaftSnapshotRestore
Feb 25, 2022
VinnyHC
force-pushed
the
vinnyhc/VAULT-5003_retry
branch
from
February 28, 2022 22:32
19a9775
to
4e329d9
Compare
averche
reviewed
Mar 1, 2022
ncabatoff
reviewed
Mar 1, 2022
averche
approved these changes
Mar 2, 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.
One optional comment, LGTM otherwise 👍
ncabatoff
reviewed
Mar 14, 2022
ncabatoff
approved these changes
Mar 14, 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.
Nice work!
VinnyHC
force-pushed
the
vinnyhc/VAULT-5003_retry
branch
from
March 14, 2022 16:40
aec2679
to
b94c8d8
Compare
This was referenced Apr 1, 2022
Merged
Merged
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.
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: