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 ErrBucketAlreadyOwnedByYou
ErrInvalidDuration ErrInvalidDuration
ErrBucketAlreadyExists ErrBucketAlreadyExists
ErrTooManyBuckets
ErrMetadataTooLarge ErrMetadataTooLarge
ErrUnsupportedMetadata ErrUnsupportedMetadata
ErrMaximumExpires ErrMaximumExpires
@ -695,11 +694,6 @@ var errorCodes = errorCodeMap{
Description: "The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.", Description: "The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.",
HTTPStatusCode: http.StatusBadRequest, HTTPStatusCode: http.StatusBadRequest,
}, },
ErrTooManyBuckets: {
Code: "TooManyBuckets",
Description: "You have attempted to create more buckets than allowed",
HTTPStatusCode: http.StatusBadRequest,
},
ErrBucketNotEmpty: { ErrBucketNotEmpty: {
Code: "BucketNotEmpty", Code: "BucketNotEmpty",
Description: "The bucket you tried to delete is not empty", 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 // This file is part of MinIO Object Storage stack
// //
@ -769,12 +769,9 @@ func (api objectAPIHandlers) PutBucketHandler(w http.ResponseWriter, r *http.Req
return 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 { if currBuckets := globalBucketMetadataSys.Count(); currBuckets+1 > maxBuckets {
apiErr := errorCodes.ToAPIErr(ErrTooManyBuckets) logger.LogIf(ctx, fmt.Errorf("An attempt to create %d buckets beyond recommended %d", currBuckets+1, maxBuckets))
apiErr.Description = fmt.Sprintf("You have attempted to create %d buckets than allowed %d", currBuckets+1, maxBuckets)
writeErrorResponse(ctx, w, apiErr, r.URL)
return
} }
opts := MakeBucketOptions{ opts := MakeBucketOptions{

View File

@ -17,21 +17,21 @@ For best deployment experience MinIO recommends operating systems RHEL/CentOS 8.
## Limits of S3 API ## Limits of S3 API
| Item | Specification | | 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 number of objects per bucket | no-limit |
| Maximum object size | 50 TiB | | Maximum object size | 50 TiB |
| Minimum object size | 0 B | | Minimum object size | 0 B |
| Maximum object size per PUT operation | 5 TiB | | Maximum object size per PUT operation | 5 TiB |
| Maximum number of parts per upload | 10,000 | | Maximum number of parts per upload | 10,000 |
| Part size range | 5 MiB to 5 GiB. Last part can be 0 B to 5 GiB | | Part size range | 5 MiB to 5 GiB. Last part can be 0 B to 5 GiB |
| Maximum number of parts returned per list parts request | 10000 | | Maximum number of parts returned per list parts request | 10000 |
| Maximum number of objects returned per list objects request | 1000 | | Maximum number of objects returned per list objects request | 1000 |
| Maximum number of multipart uploads returned per list multipart uploads request | 1000 | | Maximum number of multipart uploads returned per list multipart uploads request | 1000 |
| Maximum length for bucket names | 63 | | Maximum length for bucket names | 63 |
| Maximum length for object names | 1024 | | Maximum length for object names | 1024 |
| Maximum length for '/' separated object name segment | 255 | | Maximum length for '/' separated object name segment | 255 |
## List of Amazon S3 API's not supported on MinIO ## List of Amazon S3 API's not supported on MinIO