]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: apply_olh_log ignores RGW_ATTR_OLH_VER decode error 31976/head
authorCasey Bodley <cbodley@redhat.com>
Mon, 2 Dec 2019 21:59:05 +0000 (16:59 -0500)
committerCasey Bodley <cbodley@redhat.com>
Tue, 3 Dec 2019 16:26:48 +0000 (11:26 -0500)
this resolves test failures that return 400 Bad Request after:

  apply_olh_log failed to decode olh ver ''

because olh_init_modification_impl() is writing an empty attribute:

  bufferlist verbl;
  op.setxattr(RGW_ATTR_OLH_VER, verbl);

on such decode errors, link_epoch will be set to 0, and will correctly
be overwritten by real epochs from the olh log

Fixes: https://tracker.ceph.com/issues/39142
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_rados.cc

index f7066b04049e92aa8c608474c52bf5156c0cb72c..647cfbb8fc6ad649bf13af32b41e5e63b57bc34c 100644 (file)
@@ -6815,10 +6815,6 @@ int RGWRados::apply_olh_log(RGWObjectCtx& obj_ctx, RGWObjState& state, const RGW
     std::string str = olh_ver->second.to_str();
     std::string err;
     link_epoch = strict_strtoll(str.c_str(), 10, &err);
-    if (!err.empty()) {
-      ldout(cct, 0) << "apply_olh_log failed to decode olh ver '" << str << "'" << dendl;
-      return -EINVAL;
-    }
   }
   auto olh_info = state.attrset.find(RGW_ATTR_OLH_INFO);
   if (olh_info != state.attrset.end()) {