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: v14.1.0~270^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a4195fc55fb76f0a2576d5ff0b2c99ad12fd7a49;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 --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index cb76de71671..d71dcfb988f 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -3832,6 +3832,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()) {