|
|
@ -75,9 +75,6 @@ func (er erasureObjects) CopyObject(ctx context.Context, srcBucket, srcObject, d |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return oi, toObjectErr(err, srcBucket, srcObject) |
|
|
|
return oi, toObjectErr(err, srcBucket, srcObject) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
onlineDisks, metaArr = shuffleDisksAndPartsMetadataByIndex(onlineDisks, metaArr, fi.Erasure.Distribution) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if fi.Deleted { |
|
|
|
if fi.Deleted { |
|
|
|
if srcOpts.VersionID == "" { |
|
|
|
if srcOpts.VersionID == "" { |
|
|
|
return oi, toObjectErr(errFileNotFound, srcBucket, srcObject) |
|
|
|
return oi, toObjectErr(errFileNotFound, srcBucket, srcObject) |
|
|
@ -85,6 +82,8 @@ func (er erasureObjects) CopyObject(ctx context.Context, srcBucket, srcObject, d |
|
|
|
return fi.ToObjectInfo(srcBucket, srcObject), toObjectErr(errMethodNotAllowed, srcBucket, srcObject) |
|
|
|
return fi.ToObjectInfo(srcBucket, srcObject), toObjectErr(errMethodNotAllowed, srcBucket, srcObject) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onlineDisks, metaArr = shuffleDisksAndPartsMetadataByIndex(onlineDisks, metaArr, fi.Erasure.Distribution) |
|
|
|
|
|
|
|
|
|
|
|
versionID := srcInfo.VersionID |
|
|
|
versionID := srcInfo.VersionID |
|
|
|
if srcInfo.versionOnly { |
|
|
|
if srcInfo.versionOnly { |
|
|
|
versionID = dstOpts.VersionID |
|
|
|
versionID = dstOpts.VersionID |
|
|
@ -105,9 +104,11 @@ func (er erasureObjects) CopyObject(ctx context.Context, srcBucket, srcObject, d |
|
|
|
|
|
|
|
|
|
|
|
// Update `xl.meta` content on each disks.
|
|
|
|
// Update `xl.meta` content on each disks.
|
|
|
|
for index := range metaArr { |
|
|
|
for index := range metaArr { |
|
|
|
metaArr[index].ModTime = modTime |
|
|
|
if metaArr[index].IsValid() { |
|
|
|
metaArr[index].VersionID = versionID |
|
|
|
metaArr[index].ModTime = modTime |
|
|
|
metaArr[index].Metadata = srcInfo.UserDefined |
|
|
|
metaArr[index].VersionID = versionID |
|
|
|
|
|
|
|
metaArr[index].Metadata = srcInfo.UserDefined |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
tempObj := mustGetUUID() |
|
|
|
tempObj := mustGetUUID() |
|
|
@ -293,6 +294,9 @@ func (er erasureObjects) getObjectWithFileInfo(ctx context.Context, bucket, obje |
|
|
|
if disk == OfflineDisk { |
|
|
|
if disk == OfflineDisk { |
|
|
|
continue |
|
|
|
continue |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if !metaArr[index].IsValid() { |
|
|
|
|
|
|
|
continue |
|
|
|
|
|
|
|
} |
|
|
|
checksumInfo := metaArr[index].Erasure.GetChecksumInfo(partNumber) |
|
|
|
checksumInfo := metaArr[index].Erasure.GetChecksumInfo(partNumber) |
|
|
|
partPath := pathJoin(object, metaArr[index].DataDir, fmt.Sprintf("part.%d", partNumber)) |
|
|
|
partPath := pathJoin(object, metaArr[index].DataDir, fmt.Sprintf("part.%d", partNumber)) |
|
|
|
readers[index] = newBitrotReader(disk, bucket, partPath, tillOffset, |
|
|
|
readers[index] = newBitrotReader(disk, bucket, partPath, tillOffset, |
|
|
@ -1071,9 +1075,6 @@ func (er erasureObjects) PutObjectTags(ctx context.Context, bucket, object strin |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return toObjectErr(err, bucket, object) |
|
|
|
return toObjectErr(err, bucket, object) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
onlineDisks, metaArr = shuffleDisksAndPartsMetadataByIndex(onlineDisks, metaArr, fi.Erasure.Distribution) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if fi.Deleted { |
|
|
|
if fi.Deleted { |
|
|
|
if opts.VersionID == "" { |
|
|
|
if opts.VersionID == "" { |
|
|
|
return toObjectErr(errFileNotFound, bucket, object) |
|
|
|
return toObjectErr(errFileNotFound, bucket, object) |
|
|
@ -1081,22 +1082,20 @@ func (er erasureObjects) PutObjectTags(ctx context.Context, bucket, object strin |
|
|
|
return toObjectErr(errMethodNotAllowed, bucket, object) |
|
|
|
return toObjectErr(errMethodNotAllowed, bucket, object) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for i, fi := range metaArr { |
|
|
|
onlineDisks, metaArr = shuffleDisksAndPartsMetadataByIndex(onlineDisks, metaArr, fi.Erasure.Distribution) |
|
|
|
if errs[i] != nil { |
|
|
|
for i, metaFi := range metaArr { |
|
|
|
// Avoid disks where loading metadata fail
|
|
|
|
if metaFi.IsValid() { |
|
|
|
continue |
|
|
|
// clean fi.Meta of tag key, before updating the new tags
|
|
|
|
} |
|
|
|
delete(metaFi.Metadata, xhttp.AmzObjectTagging) |
|
|
|
|
|
|
|
// Don't update for empty tags
|
|
|
|
// clean fi.Meta of tag key, before updating the new tags
|
|
|
|
if tags != "" { |
|
|
|
delete(fi.Metadata, xhttp.AmzObjectTagging) |
|
|
|
metaFi.Metadata[xhttp.AmzObjectTagging] = tags |
|
|
|
// Don't update for empty tags
|
|
|
|
} |
|
|
|
if tags != "" { |
|
|
|
for k, v := range opts.UserDefined { |
|
|
|
fi.Metadata[xhttp.AmzObjectTagging] = tags |
|
|
|
metaFi.Metadata[k] = v |
|
|
|
} |
|
|
|
} |
|
|
|
for k, v := range opts.UserDefined { |
|
|
|
metaArr[i].Metadata = metaFi.Metadata |
|
|
|
fi.Metadata[k] = v |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
metaArr[i].Metadata = fi.Metadata |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
tempObj := mustGetUUID() |
|
|
|
tempObj := mustGetUUID() |
|
|
|