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
2016-07-12 01:01:47 -07:00
committed by GitHub
parent 1c82b81408
commit 126865e8df
3 changed files with 24 additions and 12 deletions
+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
}