mirror of
https://github.com/pgsty/minio.git
synced 2026-07-23 22:16:15 +03:00
fix: when parityDrives hits > len(storageDisks)/2, keep maxParity (#12387)
Additionally move out `x-minio-internal-erasure-upgraded` from HTTP headers list, as its an internal header, rename elsewhere accordingly.
This commit is contained in:
@@ -289,9 +289,10 @@ func (er erasureObjects) newMultipartUpload(ctx context.Context, bucket string,
|
||||
parityDrives = er.defaultParityCount
|
||||
}
|
||||
|
||||
ecOrg := parityDrives
|
||||
parityOrig := parityDrives
|
||||
for _, disk := range onlineDisks {
|
||||
if parityDrives >= len(onlineDisks)/2 {
|
||||
parityDrives = len(onlineDisks) / 2
|
||||
break
|
||||
}
|
||||
if disk == nil {
|
||||
@@ -303,8 +304,8 @@ func (er erasureObjects) newMultipartUpload(ctx context.Context, bucket string,
|
||||
parityDrives++
|
||||
}
|
||||
}
|
||||
if ecOrg != parityDrives {
|
||||
opts.UserDefined[xhttp.MinIOErasureUpgraded] = fmt.Sprintf("%d->%d", ecOrg, parityDrives)
|
||||
if parityOrig != parityDrives {
|
||||
opts.UserDefined[minIOErasureUpgraded] = strconv.Itoa(parityOrig) + "->" + strconv.Itoa(parityDrives)
|
||||
}
|
||||
|
||||
dataDrives := len(onlineDisks) - parityDrives
|
||||
|
||||
Reference in New Issue
Block a user