]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #25794 from cbodley/wip-rgw-sync-olh-attrs
authorCasey Bodley <cbodley@users.noreply.github.com>
Mon, 28 Jan 2019 14:33:52 +0000 (09:33 -0500)
committerGitHub <noreply@github.com>
Mon, 28 Jan 2019 14:33:52 +0000 (09:33 -0500)
rgw: fetch_remote_obj filters out olh attrs

Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
Reviewed-by: Mark Kogan <mkogan@redhat.com>
1  2 
src/rgw/rgw_rados.cc

index b2627f41286f9f6702c0eca97d88d6b2952dfed8,d71dcfb988f98383a09f3cb3ffb274b12b77b146..6d85671b163e51f0536dc891d0f400a9bb305a3c
@@@ -3873,13 -3832,17 +3873,22 @@@ 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);
+       }
      }
  
 +    int ret = attrs_handler(src_attrs);
 +    if (ret < 0) {
 +      return ret;
 +    }
 +
      if (plugin && src_attrs.find(RGW_ATTR_CRYPT_MODE) == src_attrs.end()) {
        //do not compress if object is encrypted
        compressor = boost::in_place(cct, plugin, filter);