diff options
author | Soumya Koduri <skoduri@redhat.com> | 2024-10-07 13:24:02 +0200 |
---|---|---|
committer | Soumya Koduri <skoduri@redhat.com> | 2024-10-22 15:38:13 +0200 |
commit | 60149ade9d5193a78fa5fd83e28919f8f36fe05d (patch) | |
tree | 9caf5c04dbed40810a7be400f3151b2320e07108 /src/rgw/driver/rados/rgw_rados.cc | |
parent | Merge PR #60106 into main (diff) | |
download | ceph-60149ade9d5193a78fa5fd83e28919f8f36fe05d.tar.xz ceph-60149ade9d5193a78fa5fd83e28919f8f36fe05d.zip |
rgw/lc: Fix issues with non-current objects with instance empty
When the bucket versioning is enabled, old plain object entry is converted
to versioned by updating its instance as "null" in its raw head/old object.
However its instance remains empty in the bi list entry. Same is the case for
the entries created after versioning is suspended and re-enabled.
So to access such objects which are non-current, we need to set rgw_obj_key.instance as
1) "null" to read the actual raw obj and
2) empty while accessing/updating their bi entry.
Fixes: https://tracker.ceph.com/issues/68402
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Diffstat (limited to 'src/rgw/driver/rados/rgw_rados.cc')
-rw-r--r-- | src/rgw/driver/rados/rgw_rados.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/rgw/driver/rados/rgw_rados.cc b/src/rgw/driver/rados/rgw_rados.cc index d154082994e..a133b54dc59 100644 --- a/src/rgw/driver/rados/rgw_rados.cc +++ b/src/rgw/driver/rados/rgw_rados.cc @@ -5089,7 +5089,7 @@ int RGWRados::copy_obj_data(RGWObjectCtx& obj_ctx, int RGWRados::transition_obj(RGWObjectCtx& obj_ctx, RGWBucketInfo& bucket_info, - const rgw_obj& obj, + rgw_obj obj, const rgw_placement_rule& placement_rule, const real_time& mtime, uint64_t olh_epoch, @@ -5120,6 +5120,11 @@ int RGWRados::transition_obj(RGWObjectCtx& obj_ctx, return -ECANCELED; } + // bi expects empty instance for the entries created when bucket versioning + // is not enabled or suspended. + if (obj.key.instance == "null") { + obj.key.instance.clear(); + } attrs.erase(RGW_ATTR_ID_TAG); attrs.erase(RGW_ATTR_TAIL_TAG); |