Skip to content

Commit

Permalink
rgw: skip sync olh info to es
Browse files Browse the repository at this point in the history
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 081d4c0)
  • Loading branch information
tianshan authored and smithfarm committed Feb 11, 2019
1 parent 1eab56e commit f84b571
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/rgw/rgw_sync_module_es.cc
Expand Up @@ -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;
}

Expand Down

0 comments on commit f84b571

Please sign in to comment.