Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion go/vt/mysqlctl/xtrabackupengine.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,11 @@ func (be *XtrabackupEngine) backupFiles(ctx context.Context, params BackupParams
// Enforce minimum block size.
blockSize = 1024
}
if _, err := copyToStripes(destWriters, backupOut, blockSize); err != nil {
// Add a buffer in front of the raw stdout pipe so io.CopyN() can use the
// buffered reader's WriteTo() method instead of allocating a new buffer
// every time.
backupOutBuf := bufio.NewReaderSize(backupOut, int(blockSize))
if _, err := copyToStripes(destWriters, backupOutBuf, blockSize); err != nil {
return replicationPosition, vterrors.Wrap(err, "cannot copy output from xtrabackup command")
}

Expand Down