diff --git a/cmd/config-common.go b/cmd/config-common.go index b2cf3b624..65e437946 100644 --- a/cmd/config-common.go +++ b/cmd/config-common.go @@ -69,7 +69,7 @@ func saveConfig(ctx context.Context, objAPI ObjectLayer, configFile string, data return err } - _, err = objAPI.PutObject(ctx, minioMetaBucket, configFile, NewPutObjReader(hashReader), ObjectOptions{}) + _, err = objAPI.PutObject(ctx, minioMetaBucket, configFile, NewPutObjReader(hashReader), ObjectOptions{MaxParity: true}) return err } diff --git a/cmd/erasure-object.go b/cmd/erasure-object.go index e1f283411..4881e417c 100644 --- a/cmd/erasure-object.go +++ b/cmd/erasure-object.go @@ -624,10 +624,13 @@ func (er erasureObjects) putObject(ctx context.Context, bucket string, object st storageDisks := er.getDisks() - // Get parity and data drive count based on storage class metadata - parityDrives := globalStorageClass.GetParityForSC(opts.UserDefined[xhttp.AmzStorageClass]) - if parityDrives <= 0 { - parityDrives = er.defaultParityCount + parityDrives := len(storageDisks) / 2 + if !opts.MaxParity { + // Get parity and data drive count based on storage class metadata + parityDrives = globalStorageClass.GetParityForSC(opts.UserDefined[xhttp.AmzStorageClass]) + if parityDrives <= 0 { + parityDrives = er.defaultParityCount + } } dataDrives := len(storageDisks) - parityDrives diff --git a/cmd/object-api-interface.go b/cmd/object-api-interface.go index 5e22c1205..0598ba0de 100644 --- a/cmd/object-api-interface.go +++ b/cmd/object-api-interface.go @@ -55,6 +55,10 @@ type ObjectOptions struct { ProxyRequest bool // only set for GET/HEAD in active-active replication scenario ProxyHeaderSet bool // only set for GET/HEAD in active-active replication scenario ParentIsObject func(ctx context.Context, bucket, parent string) bool // Used to verify if parent is an object. + + // Use the maximum parity (N/2), used when + // saving server configuration files + MaxParity bool } // BucketOptions represents bucket options for ObjectLayer bucket operations