]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: skip sync olh info to es
authorTianshan Qu <tianshan@xsky.com>
Tue, 24 Apr 2018 16:23:33 +0000 (00:23 +0800)
committerTianshan Qu <tianshan@xsky.com>
Wed, 21 Nov 2018 09:40:06 +0000 (17:40 +0800)
sync null versioned object will get olh info

fixes: http://tracker.ceph.com/issues/23842

Signed-off-by: Tianshan Qu <tianshan@xsky.com>
src/rgw/rgw_sync_module_es.cc

index 9d6222476dd28c81798e106c6e1719e7ea544aa0..c8c7ba7156394cc54a3e11be25669902effb56dd 100644 (file)
@@ -286,17 +286,22 @@ struct es_obj_metadata {
       const string& attr_name = i.first;
       bufferlist& val = i.second;
 
-      if (attr_name.compare(0, sizeof(RGW_ATTR_PREFIX) - 1, RGW_ATTR_PREFIX) != 0) {
+      if (!boost::algorithm::starts_with(attr_name, RGW_ATTR_PREFIX)) {
         continue;
       }
 
-      if (attr_name.compare(0, sizeof(RGW_ATTR_META_PREFIX) - 1, RGW_ATTR_META_PREFIX) == 0) {
+      if (boost::algorithm::starts_with(attr_name, RGW_ATTR_META_PREFIX)) {
         custom_meta.emplace(attr_name.substr(sizeof(RGW_ATTR_META_PREFIX) - 1),
                             string(val.c_str(), (val.length() > 0 ? val.length() - 1 : 0)));
         continue;
       }
 
-      if (attr_name.compare(0, sizeof(RGW_ATTR_CRYPT_PREFIX) -1, RGW_ATTR_CRYPT_PREFIX) == 0) {
+      if (boost::algorithm::starts_with(attr_name, RGW_ATTR_CRYPT_PREFIX)) {
+        continue;
+      }
+
+      if (boost::algorithm::starts_with(attr_name, RGW_ATTR_OLH_PREFIX)) {
+        // skip versioned object olh info
         continue;
       }