From: Tianshan Qu Date: Tue, 24 Apr 2018 16:23:33 +0000 (+0800) Subject: rgw: skip sync olh info to es X-Git-Tag: v12.2.12~26^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f84b5718ebbd19a722e4aa5a30350b351a0af967;p=ceph.git rgw: skip sync olh info to es sync null versioned object will get olh info fixes: http://tracker.ceph.com/issues/23842 Signed-off-by: Tianshan Qu (cherry picked from commit 081d4c0e13188708cf5f3efffc7e838d9fad3e65) --- diff --git a/src/rgw/rgw_sync_module_es.cc b/src/rgw/rgw_sync_module_es.cc index aa58219b5a9..be6d1f18a8b 100644 --- a/src/rgw/rgw_sync_module_es.cc +++ b/src/rgw/rgw_sync_module_es.cc @@ -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; }