From: Casey Bodley Date: Fri, 4 Jan 2019 20:53:34 +0000 (-0500) Subject: rgw: fetch_remote_obj filters out olh attrs X-Git-Tag: v13.2.7~236^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=eede421e3d37420af9348948aa0604471d3caac5;p=ceph.git rgw: fetch_remote_obj filters out olh attrs each zone manages its own olh log, so we don't want any of the source zone's olh attributes. in one case (sync of an object overwrite in a versioning-suspended bucket), these olh attributes were being written directly to the head object and leading to link_olh errors due to the olh_tag mismatch Fixes: http://tracker.ceph.com/issues/37792 Signed-off-by: Casey Bodley (cherry picked from commit a4195fc55fb76f0a2576d5ff0b2c99ad12fd7a49) --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 3ca45acacd5..b798291bd93 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -7589,6 +7589,15 @@ public: src_attrs.erase(RGW_ATTR_COMPRESSION); src_attrs.erase(RGW_ATTR_MANIFEST); // not interested in original object layout + + // filter out olh attributes + auto iter = src_attrs.lower_bound(RGW_ATTR_OLH_PREFIX); + while (iter != src_attrs.end()) { + if (!boost::algorithm::starts_with(iter->first, RGW_ATTR_OLH_PREFIX)) { + break; + } + iter = src_attrs.erase(iter); + } } if (plugin && src_attrs.find(RGW_ATTR_CRYPT_MODE) == src_attrs.end()) {