mirror of
https://github.com/minio/minio.git
synced 2025-01-26 14:13:16 -05:00
XL/mutltipart: fix partnumber to partname association. (#1739)
Fixes #1738
This commit is contained in:
parent
a00a5c6e7e
commit
6d84e84b3c
@ -6,7 +6,7 @@
|
||||
},
|
||||
"parts": [
|
||||
{
|
||||
"name": "object1",
|
||||
"name": "object00001",
|
||||
"size": 29,
|
||||
"eTag": "",
|
||||
},
|
||||
|
@ -3,17 +3,17 @@
|
||||
{
|
||||
"size": 5242880,
|
||||
"etag": "3565c6e741e69a007a5ac7db893a62b5",
|
||||
"name": "object1"
|
||||
"name": "object00001"
|
||||
},
|
||||
{
|
||||
"size": 5242880,
|
||||
"etag": "d416712335c280ab1e39498552937764",
|
||||
"name": "object2"
|
||||
"name": "object00002"
|
||||
},
|
||||
{
|
||||
"size": 4338324,
|
||||
"etag": "8a98c5c54d81c6c95ed9bdcaeb941aaf",
|
||||
"name": "object3"
|
||||
"name": "object00003"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
|
@ -125,7 +125,7 @@ func (xl xlObjects) putObjectPartCommon(bucket string, object string, uploadID s
|
||||
nsMutex.Lock(minioMetaBucket, pathJoin(mpartMetaPrefix, bucket, object, uploadID, strconv.Itoa(partID)))
|
||||
defer nsMutex.Unlock(minioMetaBucket, pathJoin(mpartMetaPrefix, bucket, object, uploadID, strconv.Itoa(partID)))
|
||||
|
||||
partSuffix := fmt.Sprintf("object%d", partID)
|
||||
partSuffix := fmt.Sprintf("object.%.5d", partID)
|
||||
tmpPartPath := path.Join(tmpMetaPrefix, bucket, object, uploadID, partSuffix)
|
||||
fileWriter, err := xl.erasureDisk.CreateFile(minioMetaBucket, tmpPartPath)
|
||||
if err != nil {
|
||||
@ -318,7 +318,7 @@ func (xl xlObjects) CompleteMultipartUpload(bucket string, object string, upload
|
||||
// Loop through all parts, validate them and then commit to disk.
|
||||
for i, part := range parts {
|
||||
// Construct part suffix.
|
||||
partSuffix := fmt.Sprintf("object%d", part.PartNumber)
|
||||
partSuffix := fmt.Sprintf("object.%.5d", part.PartNumber)
|
||||
if xlMeta.SearchObjectPart(partSuffix, part.ETag) == -1 {
|
||||
return "", InvalidPart{}
|
||||
}
|
||||
|
@ -191,7 +191,7 @@ func (xl xlObjects) PutObject(bucket string, object string, size int64, data io.
|
||||
nsMutex.Lock(bucket, object)
|
||||
defer nsMutex.Unlock(bucket, object)
|
||||
|
||||
tempErasureObj := path.Join(tmpMetaPrefix, bucket, object, "object1")
|
||||
tempErasureObj := path.Join(tmpMetaPrefix, bucket, object, "object00001")
|
||||
tempObj := path.Join(tmpMetaPrefix, bucket, object)
|
||||
fileWriter, err := xl.erasureDisk.CreateFile(minioMetaBucket, tempErasureObj)
|
||||
if err != nil {
|
||||
@ -283,7 +283,7 @@ func (xl xlObjects) PutObject(bucket string, object string, size int64, data io.
|
||||
xlMeta.Meta = metadata
|
||||
xlMeta.Stat.Size = size
|
||||
xlMeta.Stat.ModTime = modTime
|
||||
xlMeta.AddObjectPart("object1", newMD5Hex, xlMeta.Stat.Size)
|
||||
xlMeta.AddObjectPart("object00001", newMD5Hex, xlMeta.Stat.Size)
|
||||
if err = xl.writeXLMetadata(bucket, object, xlMeta); err != nil {
|
||||
return "", toObjectErr(err, bucket, object)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user