Skip to content

Commit cbcf0e3

Browse files
cbodleymattbenjamin
authored andcommitted
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 <[email protected]>
1 parent 56bf507 commit cbcf0e3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/rgw/driver/rados/rgw_rados.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7047,6 +7047,9 @@ int RGWRados::get_part_obj_state(const DoutPrefixProvider* dpp, optional_yield y
70477047

70487048
// update the object size
70497049
sm->state.size = part_manifest.get_obj_size();
7050+
if (!sm->state.attrset.count(RGW_ATTR_COMPRESSION)) {
7051+
sm->state.accounted_size = sm->state.size;
7052+
}
70507053

70517054
*pmanifest = &part_manifest;
70527055
return 0;

0 commit comments

Comments
 (0)