Repository navigation
rgw/set_attrs: Do not modify mtime - #52160
Conversation
|
@cbodley |
|
@cbodley @ivancich .. I have noticed that in case if Though as per https://docs.aws.amazon.com/AmazonS3/latest/userguide/add-object-metadata.html, it seems ok to promote non-current to current in case of metadata changes, I am not sure if that applies to all the cases. For eg., when lifecycle transition updates storage class of non-current objects, they do not get promoted to current. Right? But as per the doc, changes to |
Do you see text in the AWS doc specifically speaking about promoting non-current to current? That does not seem like kosher behavior to me. |
I found this note in that AWS doc Note Consider the following issues when you are editing object metadata in Amazon S3: <<< |
cbodley
left a comment
There was a problem hiding this comment.
otherwise looks good. can we find a way to test this in s3tests?
There was a problem hiding this comment.
epoch and olh_epoch are two different things. i think you just want to pass olh_epoch=0 into set_olh(), which should cause cls_rgw.cc's rgw_bucket_link_olh() -> start_modify() to increment its stored olh_epoch
i agree this seems unexpected here. i think that text was specific to object metadata, where the only way to change it is by copying the object over itself with updated metadata. in a versioned bucket, that would indeed create a new version and make it current but looking at docs for PutObjectAcl specifically:
it sounds like the intent is to apply the updated ACLs to those existing versions without changing the current version. as you point out, |
|
it's actually not clear to me that PutObjectACL is supposed to update the mtime. while i wouldn't consider the "Sample Responses" in https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectAcl.html to be conclusive evidence, they return wildly different header values for Date vs. Last-Modified:
going back to the doc about object metadata https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingMetadata.html, the very first paragraph reads:
and because Last-Modified is listed under 'System-defined object metadata':
i would conclude that the only way to modify that mtime is by copying the object, not by calling PutObjectACL |
|
i used my free aws account to test this out with boto3, and found that the value of |
|
Thanks Casey and Matt.
So would it apply to any metadata change via |
the ops that are supposed to update the mtime should already be going through the copy path that handles this correctly. i think |
c33e564 to
291366c
Compare
Thanks Casey. Updated the PR. Since there is no change in mtime, I think there is no need to update bi entry now. |
|
looks good, thanks. would you be willing to add test cases for ListObjects and HeadObject to verify that neither mtime changes on PutObjectACL? |
sure..will add testcases and update. |
As per https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingMetadata.html, the only way for users to modify object metadata is to make a copy of the object and set the metadata. Hence retain old mtime for any other attr changes Signed-off-by: Soumya Koduri <[email protected]>
291366c to
31666d7
Compare
|
confirmed that the test case fails against main: and passes against this pr 👍 |
mattbenjamin
left a comment
There was a problem hiding this comment.
ack, thanks soumya, casey
|
(note that my #51842 is using |
Thanks Casey |
As per https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingMetadata.html, the only way for users to modify object metadata is to make a copy of the object and set the metadata. Hence retain old mtime for any other attr changes Resolves: rhbz#2213801 Fixes: https://tracker.ceph.com/issues/61770 References: ceph#52160 Signed-off-by: Soumya Koduri <[email protected]> (cherry picked from commit 31666d7)
As per https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingMetadata.html, the only way for users to modify object metadata is to make a copy of the object and set the metadata. Hence retain old mtime for any other attr changes via
set_attrs.Fixes: https://tracker.ceph.com/issues/61770
Signed-off-by: Soumya Koduri[email protected]
Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windows