mirror of
https://github.com/minio/minio.git
synced 2025-04-26 04:52:25 -04:00
fs: Remove object append file if found since it is not always used (#3139)
This commit is contained in:
parent
9db2205db3
commit
4b302173ae
@ -669,6 +669,8 @@ func (fs fsObjects) CompleteMultipartUpload(bucket string, object string, upload
|
|||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fsAppendDataPath := getFSAppendDataPath(uploadID)
|
||||||
|
|
||||||
// Read saved fs metadata for ongoing multipart.
|
// Read saved fs metadata for ongoing multipart.
|
||||||
fsMetaPath := pathJoin(uploadIDPath, fsMetaJSONFile)
|
fsMetaPath := pathJoin(uploadIDPath, fsMetaJSONFile)
|
||||||
fsMeta, err := readFSMetadata(fs.storage, minioMetaBucket, fsMetaPath)
|
fsMeta, err := readFSMetadata(fs.storage, minioMetaBucket, fsMetaPath)
|
||||||
@ -678,13 +680,13 @@ func (fs fsObjects) CompleteMultipartUpload(bucket string, object string, upload
|
|||||||
|
|
||||||
fsAppendMeta, err := readFSMetadata(fs.storage, minioMetaBucket, fsAppendMetaPath)
|
fsAppendMeta, err := readFSMetadata(fs.storage, minioMetaBucket, fsAppendMetaPath)
|
||||||
if err == nil && isPartsSame(fsAppendMeta.Parts, parts) {
|
if err == nil && isPartsSame(fsAppendMeta.Parts, parts) {
|
||||||
fsAppendDataPath := getFSAppendDataPath(uploadID)
|
|
||||||
if err = fs.storage.RenameFile(minioMetaBucket, fsAppendDataPath, bucket, object); err != nil {
|
if err = fs.storage.RenameFile(minioMetaBucket, fsAppendDataPath, bucket, object); err != nil {
|
||||||
return "", toObjectErr(traceError(err), minioMetaBucket, fsAppendDataPath)
|
return "", toObjectErr(traceError(err), minioMetaBucket, fsAppendDataPath)
|
||||||
}
|
}
|
||||||
// Remove the append-file metadata file in tmp location as we no longer need it.
|
|
||||||
fs.storage.DeleteFile(minioMetaBucket, fsAppendMetaPath)
|
|
||||||
} else {
|
} else {
|
||||||
|
// Remove append data temporary file since it is no longer needed at this point
|
||||||
|
fs.storage.DeleteFile(minioMetaBucket, fsAppendDataPath)
|
||||||
|
|
||||||
tempObj := path.Join(tmpMetaPrefix, uploadID+"-"+"part.1")
|
tempObj := path.Join(tmpMetaPrefix, uploadID+"-"+"part.1")
|
||||||
|
|
||||||
// Allocate staging buffer.
|
// Allocate staging buffer.
|
||||||
@ -761,6 +763,9 @@ func (fs fsObjects) CompleteMultipartUpload(bucket string, object string, upload
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove the append-file metadata file in tmp location as we no longer need it.
|
||||||
|
fs.storage.DeleteFile(minioMetaBucket, fsAppendMetaPath)
|
||||||
|
|
||||||
// No need to save part info, since we have concatenated all parts.
|
// No need to save part info, since we have concatenated all parts.
|
||||||
fsMeta.Parts = nil
|
fsMeta.Parts = nil
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user