]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
rgw: write meta of a MP part to a correct pool
authorJeegn Chen <jeegnchen@tencent.com>
Mon, 8 Mar 2021 14:27:44 +0000 (22:27 +0800)
committerJeegn Chen <jeegnchen@tencent.com>
Fri, 28 May 2021 11:47:14 +0000 (11:47 +0000)
commit7647823bd42ce8228c3622a91e87680ee22df710
treeebda5e4360d8f59d260c1c985162fd2a146d149f
parent0331281e8a74d0b744cdcede1db24e7fea4656fc
rgw: write meta of a MP part to a correct pool

When uploading a multipart part to a non-default storage class,
original logic writes the object data to the correct pool
for its storage class.
But when completing the upload, there's another write op
(with a bunch of setxattrs) to the head object targeting
the standard pool (because non-multipart uploads
write their head objects to the default pool).
As a result of this setxattrs op, a redundant zero-sized object is
created in a wrong pool. Multipart complete, multipart abort and
GC would never try to it clean up.

The fix is to make RGWRados::Object::Write::_do_write_meta() learn the
difference between multipart and non-multipart head objects and pick the
correct placement rule for RGWRados::get_obj_head_ref().

Fixes: http://tracker.ceph.com/issues/49128
Signed-off-by: Jeegn Chen <jeegnchen@tencent.com>
src/rgw/rgw_putobj_processor.cc
src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h
src/rgw/rgw_sal.h
src/rgw/rgw_sal_rados.cc