rich7420 opened a new pull request, #10752:
URL: https://github.com/apache/ozone/pull/10752
## What changes were proposed in this pull request?
A CopyObject request whose source and destination are the same key was
rejected with 400 InvalidRequest ("This copy request is illegal because it is
trying to copy an object to it self ...") whenever no x-amz-storage-class
header was present. This ignored the metadata and tagging directives.
AWS S3 permits a self-copy as long as at least one attribute is changed,
including user metadata (x-amz-metadata-directive: REPLACE) or the tag set
(x-amz-tagging-directive: REPLACE). The in-place metadata update (self-copy
with MetadataDirective=REPLACE) is the canonical way to change an object's
metadata.
The self-copy guard in ObjectEndpoint only accounted for the storage-class
case. This change reads the metadata and tagging directives up front and only
rejects the self-copy when neither directive is REPLACE (and the storage type
is default). When either is REPLACE, the request falls through to the normal
copy path, which replaces the metadata or tags in place. The storage-class-only
self-copy behaviour is unchanged.
## What is the link to the Apache JIRA?
https://issues.apache.org/jira/browse/HDDS-15852
## How was this patch tested?
https://github.com/rich7420/ozone/actions/runs/29305530153
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]