]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/rados: get_part_obj_state() fixes accounted_size when uncompressed
authorCasey Bodley <cbodley@redhat.com>
Fri, 18 Oct 2024 17:27:51 +0000 (13:27 -0400)
committerMatt Benjamin <mbenjamin@redhat.com>
Wed, 8 Jan 2025 00:17:33 +0000 (19:17 -0500)
the part head objects don't have a RGW_ATTR_MANIFEST attribute, so
get_obj_state_impl() isn't able to set the correct
RGWObjState::accounted_size unless RGW_ATTR_COMPRESSION provides one

get_part_obj_state() builds a fake manifest in memory to represent the
part and updates state.size accordingly, but it hadn't corrected the
value of state.accounted_size

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/driver/rados/rgw_rados.cc

index 14882e6d07ccaa3f56e23d824c243c263ac07ed2..69075c506f190db5930c5ffad77080eaa94683e6 100644 (file)
@@ -7047,6 +7047,9 @@ int RGWRados::get_part_obj_state(const DoutPrefixProvider* dpp, optional_yield y
 
   // update the object size
   sm->state.size = part_manifest.get_obj_size();
+  if (!sm->state.attrset.count(RGW_ATTR_COMPRESSION)) {
+    sm->state.accounted_size = sm->state.size;
+  }
 
   *pmanifest = &part_manifest;
   return 0;