mirror of
https://github.com/minio/minio.git
synced 2024-12-24 22:25:54 -05:00
XL/Multipart: Cleanup uploads.json after abort-multipart-upload. (#1678)
Fixes #1663
This commit is contained in:
parent
b69a97aed4
commit
71b9341fc7
@ -237,7 +237,25 @@ func abortMultipartUploadCommon(storage StorageAPI, bucket, object, uploadID str
|
|||||||
if !isUploadIDExists(storage, bucket, object, uploadID) {
|
if !isUploadIDExists(storage, bucket, object, uploadID) {
|
||||||
return InvalidUploadID{UploadID: uploadID}
|
return InvalidUploadID{UploadID: uploadID}
|
||||||
}
|
}
|
||||||
return cleanupUploadedParts(storage, bucket, object, uploadID)
|
|
||||||
|
if err := cleanupUploadedParts(storage, bucket, object, uploadID); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate if there are other incomplete upload-id's present for
|
||||||
|
// the object, if yes do not attempt to delete 'uploads.json'.
|
||||||
|
if entries, err := storage.ListDir(minioMetaBucket, path.Join(mpartMetaPrefix, bucket, object)); err == nil {
|
||||||
|
if len(entries) > 1 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
uploadsJSONPath := path.Join(mpartMetaPrefix, bucket, object, uploadsJSONFile)
|
||||||
|
if err := storage.DeleteFile(minioMetaBucket, uploadsJSONPath); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// isIncompleteMultipart - is object incomplete multipart.
|
// isIncompleteMultipart - is object incomplete multipart.
|
||||||
|
Loading…
Reference in New Issue
Block a user