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

Port consul changes to snapshot #4

Merged
merged 3 commits into from
Jun 5, 2020
Merged

Conversation

notnoop
Copy link
Contributor

@notnoop notnoop commented Jun 3, 2020

Since extracting this package, Consul has made some minor improvements in handling truncated and invalid snapshots as well as handling gzip closing changes.

This captures changes in hashicorp/consul#7697

Mahmood Ali added 2 commits June 2, 2020 18:20
Consul has made some minor improvements in handling truncated and
invalid snapshots as well as handling gzip closing changes.
@notnoop notnoop requested review from rboyer and briankassouf June 3, 2020 11:24
@@ -172,11 +172,11 @@ func Verify(in io.Reader) (*raft.SnapshotMeta, error) {
// The docs for gzip.Reader say: "Clients should treat data returned by Read as
// tentative until they receive the io.EOF marking the end of the data."
func concludeGzipRead(decomp *gzip.Reader) error {
extra, err := ioutil.ReadAll(decomp) // ReadAll consumes the EOF
extra, err := io.Copy(ioutil.Discard, decomp) // Copy consumes the EOF
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is an add-on change, not from consul.

@briankassouf briankassouf merged commit ef3642a into master Jun 5, 2020
@briankassouf briankassouf deleted the port-consul-20200602 branch June 5, 2020 18:07
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