XL/bucket: Remove bucket should cleanup incomplete uploads as well. (#2173)

This behavior is in accordance with S3.

Fixes #2170
This commit is contained in:
Harshavardhana authored and GitHub committed 2016-07-12 01:01:47 -07:00
1 parent 1c82b81408
commit 126865e8df
3 files changed
+24 -12

No files matched your search

+5
View File
@@ -199,9 +199,14 @@ func (fs fsObjects) DeleteBucket(bucket string) error {
if !IsValidBucketName(bucket) {
return BucketNameInvalid{Bucket: bucket}
}
// Attempt to delete regular bucket.
if err := fs.storage.DeleteVol(bucket); err != nil {
return toObjectErr(err, bucket)
}
// Cleanup all the previously incomplete multiparts.
if err := cleanupDir(fs.storage, path.Join(minioMetaBucket, mpartMetaPrefix), bucket); err != nil {
return toObjectErr(err, bucket)
}
return nil
}