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

Never return negative values from Write, as they can panic in bufio #33

Merged
merged 2 commits into from
May 15, 2020

Conversation

ajm188
Copy link
Contributor

@ajm188 ajm188 commented May 15, 2020

Fixes #32.

gzip.go Outdated Show resolved Hide resolved
Co-authored-by: Klaus Post <[email protected]>
@klauspost
Copy link
Owner

Thanks for the contribution. I will make a new release.

@klauspost klauspost merged commit 82f3a65 into klauspost:master May 15, 2020
@ajm188 ajm188 deleted the am_non_negative_writes branch May 15, 2020 15:54
ajm188 added a commit to tinyspeck/vitess that referenced this pull request May 15, 2020
This upgrades pgzip to include a
[fix](klauspost/pgzip#33) to prevent negative
byte counts being returned from `pgzip.Write`, which cause panics in
`bufio`.

These panics manifest when using compressed xtrabackup backups as:

```
Error: <_Rendezvous of RPC that terminated with
(StatusCode.UNKNOWN, caught panic during Backup: bufio: writer returned negative count from Write)>
```

Signed-off-by: Andrew Mason <[email protected]>
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.

pgzip.Writer causes panics in bufio.Write
2 participants