mirror of
https://github.com/minio/minio.git
synced 2025-11-29 21:33:31 -05:00
XL/fs: Optimize calling isBucketExist() (#1656)
* posix: Avoid using getAllVolumeInfo() in getVolumeDir() This is necessary compromise to avoid significant slowness this causes under load. The compromise is also substantial in a way so that to avoid penalizing common cases v/s special cases. For buckets with Caps on Unixes, we filter buckets based on the latest anyways, so this is completely acceptable. * XL/fs: Change the usage of verification of existance of buckets. Optimize calling isBucketExists, it is not needed for all call paths. isBucketExist should be called only for calls which use temporary volume location for operations, for the rest rely on the errors returned on their original call path. Remove usage of filtering as well across all volume names.
This commit is contained in:
committed by
Anand Babu (AB) Periasamy
parent
4214da65af
commit
4bc923e63b
@@ -146,9 +146,6 @@ func (xl xlObjects) GetObject(bucket, object string, startOffset int64) (io.Read
|
||||
if !IsValidBucketName(bucket) {
|
||||
return nil, BucketNameInvalid{Bucket: bucket}
|
||||
}
|
||||
if !isBucketExist(xl.storage, bucket) {
|
||||
return nil, BucketNotFound{Bucket: bucket}
|
||||
}
|
||||
// Verify if object is valid.
|
||||
if !IsValidObjectName(object) {
|
||||
return nil, ObjectNameInvalid{Bucket: bucket, Object: object}
|
||||
@@ -261,10 +258,6 @@ func (xl xlObjects) GetObjectInfo(bucket, object string) (ObjectInfo, error) {
|
||||
if !IsValidBucketName(bucket) {
|
||||
return ObjectInfo{}, BucketNameInvalid{Bucket: bucket}
|
||||
}
|
||||
// Check whether the bucket exists.
|
||||
if !isBucketExist(xl.storage, bucket) {
|
||||
return ObjectInfo{}, BucketNotFound{Bucket: bucket}
|
||||
}
|
||||
// Verify if object is valid.
|
||||
if !IsValidObjectName(object) {
|
||||
return ObjectInfo{}, ObjectNameInvalid{Bucket: bucket, Object: object}
|
||||
@@ -282,7 +275,7 @@ func (xl xlObjects) PutObject(bucket string, object string, size int64, data io.
|
||||
if !IsValidBucketName(bucket) {
|
||||
return "", BucketNameInvalid{Bucket: bucket}
|
||||
}
|
||||
// Check whether the bucket exists.
|
||||
// Verify bucket exists.
|
||||
if !isBucketExist(xl.storage, bucket) {
|
||||
return "", BucketNotFound{Bucket: bucket}
|
||||
}
|
||||
@@ -433,9 +426,6 @@ func (xl xlObjects) DeleteObject(bucket, object string) error {
|
||||
if !IsValidBucketName(bucket) {
|
||||
return BucketNameInvalid{Bucket: bucket}
|
||||
}
|
||||
if !isBucketExist(xl.storage, bucket) {
|
||||
return BucketNotFound{Bucket: bucket}
|
||||
}
|
||||
if !IsValidObjectName(object) {
|
||||
return ObjectNameInvalid{Bucket: bucket, Object: object}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user