]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: apply_olh_log should clear_olh before trimming olh log
authorCory Snyder <csnyder@1111systems.com>
Wed, 14 Jun 2023 14:01:43 +0000 (14:01 +0000)
committerCory Snyder <csnyder@1111systems.com>
Tue, 4 Jul 2023 09:45:46 +0000 (09:45 +0000)
When pending_removal is true and the log is trimmed prior to
clearing olh, it allows for the possibility that the olh is not
cleared (e.g. due to new pending xattrs on the olh obj), but the
olh log entries are removed.

Signed-off-by: Cory Snyder <csnyder@1111systems.com>
src/rgw/driver/rados/rgw_rados.cc

index e3f0054dd617ec01d4b7d98137529f908eacbb67..1de5ce56f6e05dcc0cba40126648988f27c425a8 100644 (file)
@@ -7544,17 +7544,21 @@ int RGWRados::apply_olh_log(const DoutPrefixProvider *dpp,
     return r;
   }
 
+  if (need_to_remove) {
+    string olh_tag(state.olh_tag.c_str(), state.olh_tag.length());
+    r = clear_olh(dpp, obj_ctx, obj, bucket_info, ref, olh_tag, last_ver, y);
+    if (r < 0 && r != -ECANCELED) {
+      ldpp_dout(dpp, 0) << "ERROR: could not clear olh, r=" << r << dendl;
+      return r;
+    }
+  }
+
   r = bucket_index_trim_olh_log(dpp, bucket_info, state, obj, last_ver, y);
-  if (r < 0) {
+  if (r < 0 && r != -ECANCELED) {
     ldpp_dout(dpp, 0) << "ERROR: could not trim olh log, r=" << r << dendl;
     return r;
   }
 
-  if (need_to_remove) {
-    string olh_tag(state.olh_tag.c_str(), state.olh_tag.length());
-    clear_olh(dpp, obj_ctx, obj, bucket_info, ref, olh_tag, last_ver, y);
-  }
-
   return 0;
 }