mirror of
https://github.com/pgsty/minio.git
synced 2026-08-09 15:53:28 +03:00
XL: Make sure to create proper temporary files for renames to succeed. (#1654)
Renames work in a special manner, temporary location files should be created properly. Fixes #1653 Fixes #1651
This commit is contained in:
@@ -39,7 +39,8 @@ const (
|
||||
func createUploadsJSON(storage StorageAPI, bucket, object, uploadID string) error {
|
||||
// Place holder uploads.json
|
||||
uploadsPath := path.Join(mpartMetaPrefix, bucket, object, uploadsJSONFile)
|
||||
tmpUploadsPath := path.Join(tmpMetaPrefix, bucket, object, uploadID, uploadsJSONFile)
|
||||
uploadsJSONSuffix := fmt.Sprintf("%s.%s", uploadID, uploadsJSONFile)
|
||||
tmpUploadsPath := path.Join(tmpMetaPrefix, bucket, object, uploadsJSONSuffix)
|
||||
w, err := storage.CreateFile(minioMetaBucket, uploadsPath)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -98,7 +99,8 @@ func newMultipartUploadCommon(storage StorageAPI, bucket string, object string)
|
||||
return "", err
|
||||
}
|
||||
uploadIDPath := path.Join(mpartMetaPrefix, bucket, object, uploadID, incompleteFile)
|
||||
tempUploadIDPath := path.Join(tmpMetaPrefix, bucket, object, uploadID, incompleteFile)
|
||||
incompleteSuffix := fmt.Sprintf("%s.%s", uploadID, incompleteFile)
|
||||
tempUploadIDPath := path.Join(tmpMetaPrefix, bucket, object, incompleteSuffix)
|
||||
if _, err = storage.StatFile(minioMetaBucket, uploadIDPath); err != nil {
|
||||
if err != errFileNotFound {
|
||||
return "", toObjectErr(err, minioMetaBucket, uploadIDPath)
|
||||
|
||||
Reference in New Issue
Block a user