Skip to content

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

Merged
klauspost merged 2 commits intoklauspost:masterfrom
ajm188:am_non_negative_writes
May 15, 2020
Merged

Never return negative values from Write, as they can panic in bufio#33
klauspost merged 2 commits intoklauspost:masterfrom
ajm188:am_non_negative_writes

Conversation

@ajm188
Copy link
Copy Markdown

@ajm188 ajm188 commented May 15, 2020

Fixes #32.

Co-authored-by: Klaus Post <klauspost@gmail.com>
@klauspost
Copy link
Copy Markdown
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 pushed 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 <amason@slack-corp.com>
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