remove hard limit for number of buckets (#16194)

This commit is contained in:
Harshavardhana 2022-12-08 12:24:03 -08:00 committed by GitHub
parent 4bc367c490
commit b03dd1af17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 218 additions and 228 deletions

View File

@ -177,7 +177,6 @@ const (
ErrBucketAlreadyOwnedByYou
ErrInvalidDuration
ErrBucketAlreadyExists
ErrTooManyBuckets
ErrMetadataTooLarge
ErrUnsupportedMetadata
ErrMaximumExpires
@ -695,11 +694,6 @@ var errorCodes = errorCodeMap{
Description: "The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.",
HTTPStatusCode: http.StatusBadRequest,
},
ErrTooManyBuckets: {
Code: "TooManyBuckets",
Description: "You have attempted to create more buckets than allowed",
HTTPStatusCode: http.StatusBadRequest,
},
ErrBucketNotEmpty: {
Code: "BucketNotEmpty",
Description: "The bucket you tried to delete is not empty",

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015-2021 MinIO, Inc.
// Copyright (c) 2015-2022 MinIO, Inc.
//
// This file is part of MinIO Object Storage stack
//
@ -769,12 +769,9 @@ func (api objectAPIHandlers) PutBucketHandler(w http.ResponseWriter, r *http.Req
return
}
// check if client is attempting to create more buckets than allowed maximum.
// check if client is attempting to create more buckets, complain about it.
if currBuckets := globalBucketMetadataSys.Count(); currBuckets+1 > maxBuckets {
apiErr := errorCodes.ToAPIErr(ErrTooManyBuckets)
apiErr.Description = fmt.Sprintf("You have attempted to create %d buckets than allowed %d", currBuckets+1, maxBuckets)
writeErrorResponse(ctx, w, apiErr, r.URL)
return
logger.LogIf(ctx, fmt.Errorf("An attempt to create %d buckets beyond recommended %d", currBuckets+1, maxBuckets))
}
opts := MakeBucketOptions{

View File

@ -18,8 +18,8 @@ For best deployment experience MinIO recommends operating systems RHEL/CentOS 8.
## Limits of S3 API
| Item | Specification |
|:--------------------------------------------------------------------------------|:----------------------------------------------|
| Maximum number of buckets | 500000 |
|:--------------------------------------------------------------------------------|:------------------------------------------------|
| Maximum number of buckets | unlimited (recommend not beyond 500000 buckets) |
| Maximum number of objects per bucket | no-limit |
| Maximum object size | 50 TiB |
| Minimum object size | 0 B |