mirror of
https://github.com/ceph/ceph
synced 2025-02-24 11:37:37 +00:00
rgw/dbstore: Do not update mtime for attr change
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
This commit is contained in:
parent
016830f404
commit
a050b1d25b
@ -1082,17 +1082,21 @@ int DB::Object::set_attrs(const DoutPrefixProvider *dpp,
|
||||
DBOpParams params = {};
|
||||
rgw::sal::Attrs *attrs;
|
||||
map<string, bufferlist>::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:(" <<ret<<")" << dendl;
|
||||
if (ret && !state->exists) {
|
||||
ldpp_dout(dpp, 0) <<"get_state failed err:(" <<ret<<")" << dendl;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* For now lets keep it simple..rmattrs & setattrs ..
|
||||
* XXX: Check rgw_rados::set_attrs
|
||||
*/
|
||||
params.op.obj.state = *state;
|
||||
attrs = ¶ms.op.obj.state.attrset;
|
||||
if (rmattrs) {
|
||||
for (iter = rmattrs->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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user