Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
rgw_sal_motr : [CORTX-32485] Fix issues for get-object-tagging API wi…
Browse files Browse the repository at this point in the history
…thout version-id parameter in versioning suspended bucket (#384)

Problem Statement:
1) Get object tagging API without version-id parameter does not return tagset for latest object versions
2) Put object tagging for null version-id, adds new null object entry instead of overwrite the existing one.
Solution:
1) In put-object-tagging, removed the modified time (mtime) statement
2) For Get/HEAD object API in case of null object entry, remove the "null" from instance to avoid "VersionId" field in the response.
Signed-off-by: Priyanka Salunke <priyanka.s.salunke@seagate.com>
  • Loading branch information
priyanka25081999 authored Aug 9, 2022
1 parent 52c700d commit 0edd8ff
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/rgw/rgw_sal_motr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1651,7 +1651,15 @@ int MotrObject::fetch_obj_entry_and_key(const DoutPrefixProvider* dpp, rgw_bucke
bname = get_bucket_name(this->get_bucket()->get_tenant(), this->get_bucket()->get_name());

rgw_obj_key objkey(ent.key);
key = objkey.name + '\a' + objkey.instance;

// Remove the "null" from instance to avoid "VersionId" field in the response
// and overwrite the existing null object entry.
if (ent.key.instance == "null") {
ent.key.instance = "";
key = objkey.name + '\a';
}
else
key = objkey.name + '\a' + objkey.instance;

ldpp_dout(dpp, 20) <<__func__<< ": bucket=" << bname << " key=" << key << dendl;

Expand Down Expand Up @@ -1691,7 +1699,6 @@ int MotrObject::set_obj_attrs(const DoutPrefixProvider* dpp, RGWObjectCtx* rctx,
bufferlist update_bl;
string bucket_index_iname = "motr.rgw.bucket.index." + bname;

ent.meta.mtime = ceph::real_clock::now();
ent.encode(update_bl);
encode(attrs, update_bl);
meta.encode(update_bl);
Expand Down

0 comments on commit 0edd8ff

Please sign in to comment.