{"record":{"id":"30f079f0592e8168","repo":"vitessio/vitess","slug":"w-currently-set-to-s","errorCode":null,"errorMessage":"%w, currently set to %s","messagePattern":"%w, currently set to (.+?)","errorType":"error_code","errorClass":"ErrPartSize","httpStatus":null,"severity":"error","filePath":"go/vt/mysqlctl/s3backupstorage/s3.go","lineNumber":298,"sourceCode":"\t\tdefaultUploadPartSize = 5 * 1024 * 1024 // 5MiB\n\t\tminUploadPartSize     = 5 * 1024 * 1024 // 5MiB - S3 requirement\n\t\tmaxUploadParts        = 10000           // S3 limit\n\t)\n\n\t// Calculate s3 upload part size using the source filesize\n\tpartSizeBytes = defaultUploadPartSize\n\tif filesize > 0 {\n\t\tminimumPartSize := float64(filesize) / float64(maxUploadParts)\n\t\t// Round up to ensure large enough partsize\n\t\tcalculatedPartSizeBytes := int64(math.Ceil(minimumPartSize))\n\t\tif calculatedPartSizeBytes > partSizeBytes {\n\t\t\tpartSizeBytes = calculatedPartSizeBytes\n\t\t}\n\t}\n\n\tif minPartSize != 0 && partSizeBytes < minPartSize {\n\t\tif minPartSize > MaxPartSize || minPartSize < minUploadPartSize { // 5GiB and 5MiB respectively\n\t\t\treturn 0, fmt.Errorf(\n\t\t\t\t\"%w, currently set to %s\",\n\t\t\t\tErrPartSize, humanize.IBytes(uint64(minPartSize)),\n\t\t\t)\n\t\t}\n\t\tpartSizeBytes = int64(minPartSize)\n\t}\n\n\treturn\n}\n\n// Wait is part of the backupstorage.BackupHandle interface.\nfunc (bh *S3BackupHandle) Wait() {\n\tbh.waitGroup.Wait()\n}\n\n// EndBackup is part of the backupstorage.BackupHandle interface.\nfunc (bh *S3BackupHandle) EndBackup(ctx context.Context) error {\n\tif bh.readOnly {","sourceCodeStart":280,"sourceCodeEnd":316,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/mysqlctl/s3backupstorage/s3.go#L280-L316","documentation":"calculateUploadPartSize validates the configured part size bounds for S3 backups. When the resolved part size (or the minPartSize setting) falls below the minimum allowed (5MiB) or minPartSize exceeds the max (5GiB), it returns ErrPartSize wrapped with the current value.","triggerScenarios":"Running a backup (AddFile path) with S3BackupStorage where backup_storage_part_size / minPartSize configuration is smaller than 5MiB or minPartSize is larger than 5GiB; also triggered in tests exercising edge cases.","commonSituations":"Operators setting backup_storage_part_size to tiny values to save bandwidth; misconfigured environment producing minPartSize outside [5MiB, 5GiB]; unit mistakes (bytes vs MiB) in config.","solutions":["Set the part-size config value to at least 5MiB (5242880 bytes)","Ensure minPartSize is not greater than 5GiB (5368709120 bytes)","Check the units in your config — values are in bytes, not MiB/GiB","Fix the underlying ErrPartSize root cause message (it is wrapped here with 'currently set to' context)"],"exampleFix":"// before\nbackup_storage_part_size: 1048576 // 1MiB, below 5MiB minimum\n// after\nbackup_storage_part_size: 5242880 // 5MiB minimum","handlingStrategy":"validation","validationCode":"const minUploadPartSize = 5 * 1024 * 1024\nconst MaxPartSize = 5 * 1024 * 1024 * 1024\npartSize := cfg.BackupStoragePartSize\nif partSize < minUploadPartSize || partSize > MaxPartSize {\n    return fmt.Errorf(\"part size %d outside [%d, %d]\", partSize, minUploadPartSize, MaxPartSize)\n}","typeGuard":null,"tryCatchPattern":"partSize, err := storage.calculateUploadPartSize(...)\nif errors.Is(err, s3backupstorage.ErrPartSize) {\n    log.Error(\"invalid backup part size config\", slog.Any(\"error\", err))\n    return err\n}","preventionTips":["Keep part-size config within [5MiB, 5GiB] in deployment tooling","Document that values are bytes; add config schema validation","Add startup-time validation of backup_storage flags"],"tags":["s3","backup","configuration","part-size"],"backgroundTag":"invalid-part-size-config","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}