Skip to content
Closed
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
8 changes: 8 additions & 0 deletions go/vt/mysqlctl/s3backupstorage/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ var (

// path component delimiter
delimiter = "/"

// default partSize to use when file size is unknown in order to handle large files up to the maximum of 5 Tb
defaultPartSizeBytes = int64(math.Ceil(5 * 1024 * 1024 * 1024 * 1024 /*maxFileSize */ / s3manager.MaxUploadParts))
)

type logNameToLogLevel map[string]aws.LogLevelType
Expand Down Expand Up @@ -114,6 +117,11 @@ func (bh *S3BackupHandle) AddFile(ctx context.Context, filename string, filesize
if calculatedPartSizeBytes > partSizeBytes {
partSizeBytes = calculatedPartSizeBytes
}
} else {
// This means the file size is unknown
// Use a partSize that ensures that the largest file
// that can be written to s3 (5 Tb) fits into MaxUploadParts
partSizeBytes = defaultPartSizeBytes
}

reader, writer := io.Pipe()
Expand Down