]> 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)
committerNathan Cutler <ncutler@suse.com>
Mon, 11 Feb 2019 10:26:08 +0000 (11:26 +0100)
sync null versioned object will get olh info

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

Signed-off-by: Tianshan Qu <tianshan@xsky.com>
(cherry picked from commit 081d4c0e13188708cf5f3efffc7e838d9fad3e65)

src/rgw/rgw_sync_module_es.cc

index aa58219b5a9c2f66912b31299723fb77b54bb544..be6d1f18a8bd47ee9aaddb3b7a0d658820276970 100644 (file)
@@ -282,17 +282,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;
       }