From cbcf0e3eb2059618e5e7d309846d7c3417279660 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Fri, 18 Oct 2024 13:27:51 -0400 Subject: [PATCH] rgw/rados: get_part_obj_state() fixes accounted_size when uncompressed 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 --- src/rgw/driver/rados/rgw_rados.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/rgw/driver/rados/rgw_rados.cc b/src/rgw/driver/rados/rgw_rados.cc index 14882e6d07c..69075c506f1 100644 --- a/src/rgw/driver/rados/rgw_rados.cc +++ b/src/rgw/driver/rados/rgw_rados.cc @@ -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; -- 2.39.5