From: Soumya Koduri Date: Fri, 7 Jul 2023 11:05:57 +0000 (+0530) Subject: rgw/dbstore: Do not update mtime for attr change X-Git-Tag: v19.0.0~917^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=a050b1d25b71da57b985ecfd7d23aa757390e76e;p=ceph.git rgw/dbstore: Do not update mtime for attr change Signed-off-by: Soumya Koduri --- diff --git a/src/rgw/driver/dbstore/common/dbstore.cc b/src/rgw/driver/dbstore/common/dbstore.cc index 3936368e6f7f8..dc5a90c31873d 100644 --- a/src/rgw/driver/dbstore/common/dbstore.cc +++ b/src/rgw/driver/dbstore/common/dbstore.cc @@ -1082,17 +1082,21 @@ int DB::Object::set_attrs(const DoutPrefixProvider *dpp, DBOpParams params = {}; rgw::sal::Attrs *attrs; map::iterator iter; + RGWObjState* state; - ret = get_object_impl(dpp, params); + store->InitializeParams(dpp, ¶ms); + InitializeParamsfromObject(dpp, ¶ms); + ret = get_state(dpp, &state, true); - if (ret) { - ldpp_dout(dpp, 0) <<"get_object_impl failed err:(" <exists) { + ldpp_dout(dpp, 0) <<"get_state failed err:(" <begin(); iter != rmattrs->end(); ++iter) { @@ -1104,7 +1108,10 @@ int DB::Object::set_attrs(const DoutPrefixProvider *dpp, } params.op.query_str = "attrs"; - params.op.obj.state.mtime = real_clock::now(); + /* 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 do not update mtime for any other attr changes */ ret = store->ProcessOp(dpp, "UpdateObject", ¶ms);